✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

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

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python35/lib/python3.5/site-packages/cerberus//utils.py
from __future__ import absolute_import

from collections import Mapping, Sequence

from cerberus.platform import _int_types, _str_type


def compare_paths_lt(x, y):
    for i in range(min(len(x), len(y))):
        if isinstance(x[i], type(y[i])):
            if x[i] != y[i]:
                return x[i] < y[i]
        elif isinstance(x[i], _int_types):
            return True
        elif isinstance(y[i], _int_types):
            return False
    return len(x) < len(y)


def drop_item_from_tuple(t, i):
    return t[:i] + t[i + 1:]


def get_Validator_class():
    global Validator
    if 'Validator' not in globals():
        from cerberus.validator import Validator
    return Validator


def mapping_hash(schema):
    return hash(mapping_to_frozenset(schema))


def mapping_to_frozenset(mapping):
    """ Be aware that this treats any sequence type with the equal members as
        equal. As it is used to identify equality of schemas, this can be
        considered okay as definitions are semantically equal regardless the
        container type. """
    mapping = mapping.copy()
    for key, value in mapping.items():
        if isinstance(value, Mapping):
            mapping[key] = mapping_to_frozenset(value)
        elif isinstance(value, Sequence):
            value = list(value)
            for i, item in enumerate(value):
                if isinstance(item, Mapping):
                    value[i] = mapping_to_frozenset(item)
            mapping[key] = tuple(value)
    return frozenset(mapping.items())


def isclass(obj):
    try:
        issubclass(obj, object)
    except TypeError:
        return False
    else:
        return True


def quote_string(value):
    if isinstance(value, _str_type):
        return '"%s"' % value
    else:
        return value


def validator_factory(name, mixin=None, class_dict={}):
    """ Dynamically create a :class:`~cerberus.Validator` subclass.
        Docstrings of mixin-classes will be added to the resulting
        class' one if ``__doc__`` is not in :obj:`class_dict`.

    :param name: The name of the new class.
    :type name: :class:`str`
    :param mixin: Class(es) with mixin-methods.
    :type mixin: :class:`tuple` of or a single :term:`class`
    :param class_dict: Attributes for the new class.
    :type class_dict: :class:`dict`
    :return: The created class.
    """
    Validator = get_Validator_class()

    if mixin is None:
        bases = (Validator,)
    elif isinstance(mixin, tuple):
        bases = (Validator,) + mixin
    else:
        bases = (Validator, mixin)

    docstrings = [x.__doc__ for x in bases if x.__doc__]
    if len(docstrings) > 1 and '__doc__' not in class_dict:
        class_dict.update({'__doc__': '\n'.join(docstrings)})

    return type(name, bases, class_dict)


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
31 May 2024 1.51 PM
root / linksafe
0755
__pycache__
--
25 Jul 2024 8.44 AM
root / linksafe
0755
tests
--
25 Jul 2024 8.44 AM
root / linksafe
0755
__init__.py
0.609 KB
25 Jan 2017 6.56 AM
root / linksafe
0644
errors.py
18.947 KB
25 Jan 2017 6.56 AM
root / linksafe
0644
platform.py
0.268 KB
25 Jan 2017 6.56 AM
root / linksafe
0644
schema.py
14.395 KB
25 Jan 2017 6.56 AM
root / linksafe
0644
utils.py
2.715 KB
25 Jan 2017 6.56 AM
root / linksafe
0644
validator.py
54.475 KB
25 Jan 2017 6.56 AM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF