SILENT KILLERPanel

Current Path: > > opt > > hc_python > > lib > python3.12 > site-packages > > sqlalchemy > sql


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//hc_python//lib/python3.12/site-packages//sqlalchemy/sql

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 5820 bytes April 04 2025 08:02:28.
_dml_constructors.py File 3795 bytes April 04 2025 08:02:28.
_elements_constructors.py File 62630 bytes April 04 2025 08:02:28.
_orm_types.py File 625 bytes April 04 2025 08:02:28.
_py_util.py File 2173 bytes April 04 2025 08:02:28.
_selectable_constructors.py File 20374 bytes April 04 2025 08:02:28.
_typing.py File 12847 bytes April 04 2025 08:02:28.
annotation.py File 18245 bytes April 04 2025 08:02:28.
base.py File 73946 bytes April 04 2025 08:02:28.
cache_key.py File 33668 bytes April 04 2025 08:02:28.
coercions.py File 40653 bytes April 04 2025 08:02:28.
compiler.py File 275581 bytes April 04 2025 08:02:28.
crud.py File 56514 bytes April 04 2025 08:02:28.
ddl.py File 47430 bytes April 04 2025 08:02:28.
default_comparator.py File 16707 bytes April 04 2025 08:02:28.
dml.py File 66232 bytes April 04 2025 08:02:28.
elements.py File 177313 bytes April 04 2025 08:02:28.
events.py File 18312 bytes April 04 2025 08:02:28.
expression.py File 7586 bytes April 04 2025 08:02:28.
functions.py File 63858 bytes April 04 2025 08:02:28.
lambdas.py File 49196 bytes April 04 2025 08:02:28.
naming.py File 6858 bytes April 04 2025 08:02:28.
operators.py File 76792 bytes April 04 2025 08:02:28.
roles.py File 7662 bytes April 04 2025 08:02:28.
schema.py File 230026 bytes April 04 2025 08:02:28.
selectable.py File 241055 bytes April 04 2025 08:02:28.
sqltypes.py File 128957 bytes April 04 2025 08:02:28.
traversals.py File 33664 bytes April 04 2025 08:02:28.
type_api.py File 84837 bytes April 04 2025 08:02:28.
util.py File 48086 bytes April 04 2025 08:02:28.
visitors.py File 36319 bytes April 04 2025 08:02:28.

Reading File: //opt//hc_python//lib/python3.12/site-packages//sqlalchemy/sql/_py_util.py

# sql/_py_util.py
# Copyright (C) 2005-2025 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php

from __future__ import annotations

import typing
from typing import Any
from typing import Dict
from typing import Tuple
from typing import Union

from ..util.typing import Literal

if typing.TYPE_CHECKING:
    from .cache_key import CacheConst


class prefix_anon_map(Dict[str, str]):
    """A map that creates new keys for missing key access.

    Considers keys of the form "<ident> <name>" to produce
    new symbols "<name>_<index>", where "index" is an incrementing integer
    corresponding to <name>.

    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.

    """

    def __missing__(self, key: str) -> str:
        (ident, derived) = key.split(" ", 1)
        anonymous_counter = self.get(derived, 1)
        self[derived] = anonymous_counter + 1  # type: ignore
        value = f"{derived}_{anonymous_counter}"
        self[key] = value
        return value


class cache_anon_map(
    Dict[Union[int, "Literal[CacheConst.NO_CACHE]"], Union[Literal[True], str]]
):
    """A map that creates new keys for missing key access.

    Produces an incrementing sequence given a series of unique keys.

    This is similar to the compiler prefix_anon_map class although simpler.

    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.

    """

    _index = 0

    def get_anon(self, object_: Any) -> Tuple[str, bool]:
        idself = id(object_)
        if idself in self:
            s_val = self[idself]
            assert s_val is not True
            return s_val, True
        else:
            # inline of __missing__
            self[idself] = id_ = str(self._index)
            self._index += 1

            return id_, False

    def __missing__(self, key: int) -> str:
        self[key] = val = str(self._index)
        self._index += 1
        return val

SILENT KILLER Tool