SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib > > python3.11 > site-packages > isort


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib//python3.11/site-packages/isort

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
_vendored Directory - -
deprecated Directory - -
stdlibs Directory - -
__init__.py File 871 bytes April 17 2025 13:10:58.
__main__.py File 36 bytes April 17 2025 13:10:58.
_version.py File 72 bytes April 17 2025 13:10:58.
api.py File 26120 bytes April 17 2025 13:10:58.
comments.py File 933 bytes April 17 2025 13:10:58.
core.py File 22525 bytes April 17 2025 13:10:58.
exceptions.py File 7060 bytes April 17 2025 13:10:58.
files.py File 1589 bytes April 17 2025 13:10:58.
format.py File 5483 bytes April 17 2025 13:10:58.
hooks.py File 3338 bytes April 17 2025 13:10:58.
identify.py File 8373 bytes April 17 2025 13:10:58.
io.py File 2216 bytes April 17 2025 13:10:58.
literal.py File 3713 bytes April 17 2025 13:10:58.
logo.py File 388 bytes April 17 2025 13:10:58.
main.py File 46823 bytes April 17 2025 13:10:58.
output.py File 27804 bytes April 17 2025 13:10:58.
parse.py File 25332 bytes April 17 2025 13:10:58.
place.py File 5171 bytes April 17 2025 13:10:58.
profiles.py File 2144 bytes April 17 2025 13:10:58.
py.typed File 0 bytes April 17 2025 13:10:58.
pylama_isort.py File 1308 bytes April 17 2025 13:10:58.
sections.py File 297 bytes April 17 2025 13:10:58.
settings.py File 35584 bytes April 17 2025 13:10:58.
setuptools_commands.py File 2297 bytes April 17 2025 13:10:58.
sorting.py File 4515 bytes April 17 2025 13:10:58.
utils.py File 2413 bytes April 17 2025 13:10:58.
wrap.py File 6321 bytes April 17 2025 13:10:58.
wrap_modes.py File 13569 bytes April 17 2025 13:10:58.

Reading 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

SILENT KILLER Tool