$57 GRAYBYTE WORDPRESS FILE MANAGER $60

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.217.100
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/isort/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/isort//utils.py
import os
import sys
from pathlib import Path
from typing import Any, Dict, Optional, Tuple


class TrieNode:
    def __init__(self, config_file: str = "", config_data: Optional[Dict[str, Any]] = None) -> None:
        if not config_data:
            config_data = {}

        self.nodes: Dict[str, TrieNode] = {}
        self.config_info: Tuple[str, Dict[str, Any]] = (config_file, config_data)


class Trie:
    """
    A prefix tree to store the paths of all config files and to search the nearest config
    associated with each file
    """

    def __init__(self, config_file: str = "", config_data: Optional[Dict[str, Any]] = None) -> None:
        self.root: TrieNode = TrieNode(config_file, config_data)

    def insert(self, config_file: str, config_data: Dict[str, Any]) -> None:
        resolved_config_path_as_tuple = Path(config_file).parent.resolve().parts

        temp = self.root

        for path in resolved_config_path_as_tuple:
            if path not in temp.nodes:
                temp.nodes[path] = TrieNode()

            temp = temp.nodes[path]

        temp.config_info = (config_file, config_data)

    def search(self, filename: str) -> Tuple[str, Dict[str, Any]]:
        """
        Returns the closest config relative to filename by doing a depth
        first search on the prefix tree.
        """
        resolved_file_path_as_tuple = Path(filename).resolve().parts

        temp = self.root

        last_stored_config: Tuple[str, Dict[str, Any]] = ("", {})

        for path in resolved_file_path_as_tuple:
            if temp.config_info[0]:
                last_stored_config = temp.config_info

            if path not in temp.nodes:
                break

            temp = temp.nodes[path]

        return last_stored_config


def exists_case_sensitive(path: str) -> bool:
    """Returns if the given path exists and also matches the case on Windows.

    When finding files that can be imported, it is important for the cases to match because while
    file os.path.exists("module.py") and os.path.exists("MODULE.py") both return True on Windows,
    Python can only import using the case of the real file.
    """
    result = os.path.exists(path)
    if (sys.platform.startswith("win") or sys.platform == "darwin") and result:  # pragma: no cover
        directory, basename = os.path.split(path)
        result = basename in os.listdir(directory)
    return result


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
9 Apr 2026 8.31 AM
root / root
0755
__pycache__
--
11 Feb 2026 9.30 AM
root / root
0755
_vendored
--
20 Jan 2026 1.01 PM
root / root
0755
deprecated
--
11 Feb 2026 9.30 AM
root / root
0755
stdlibs
--
11 Feb 2026 9.30 AM
root / root
0755
__init__.py
0.851 KB
20 Jan 2026 1.01 PM
root / root
0644
__main__.py
0.035 KB
20 Jan 2026 1.01 PM
root / root
0644
_version.py
0.07 KB
20 Jan 2026 1.01 PM
root / root
0644
api.py
25.508 KB
20 Jan 2026 1.01 PM
root / root
0644
comments.py
0.911 KB
20 Jan 2026 1.01 PM
root / root
0644
core.py
21.997 KB
20 Jan 2026 1.01 PM
root / root
0644
exceptions.py
6.895 KB
20 Jan 2026 1.01 PM
root / root
0644
files.py
1.552 KB
20 Jan 2026 1.01 PM
root / root
0644
format.py
5.354 KB
20 Jan 2026 1.01 PM
root / root
0644
hooks.py
3.26 KB
20 Jan 2026 1.01 PM
root / root
0644
identify.py
8.177 KB
20 Jan 2026 1.01 PM
root / root
0644
io.py
2.164 KB
20 Jan 2026 1.01 PM
root / root
0644
literal.py
3.626 KB
20 Jan 2026 1.01 PM
root / root
0644
logo.py
0.379 KB
20 Jan 2026 1.01 PM
root / root
0644
main.py
45.726 KB
20 Jan 2026 1.01 PM
root / root
0644
output.py
27.152 KB
20 Jan 2026 1.01 PM
root / root
0644
parse.py
24.738 KB
20 Jan 2026 1.01 PM
root / root
0644
place.py
5.05 KB
20 Jan 2026 1.01 PM
root / root
0644
profiles.py
2.094 KB
20 Jan 2026 1.01 PM
root / root
0644
py.typed
0 KB
20 Jan 2026 1.01 PM
root / root
0644
pylama_isort.py
1.277 KB
20 Jan 2026 1.01 PM
root / root
0644
sections.py
0.29 KB
20 Jan 2026 1.01 PM
root / root
0644
settings.py
34.75 KB
20 Jan 2026 1.01 PM
root / root
0644
setuptools_commands.py
2.243 KB
20 Jan 2026 1.01 PM
root / root
0644
sorting.py
4.409 KB
20 Jan 2026 1.01 PM
root / root
0644
utils.py
2.356 KB
20 Jan 2026 1.01 PM
root / root
0644
wrap.py
6.173 KB
20 Jan 2026 1.01 PM
root / root
0644
wrap_modes.py
13.251 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF