GRAYBYTE WORDPRESS FILE MANAGER3050

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/html5lib/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/html5lib//utils.py
from __future__ import absolute_import, division, unicode_literals

from types import ModuleType

try:
    import xml.etree.cElementTree as default_etree
except ImportError:
    import xml.etree.ElementTree as default_etree


__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",
           "surrogatePairToCodepoint", "moduleFactoryFactory"]


class MethodDispatcher(dict):
    """Dict with 2 special properties:

    On initiation, keys that are lists, sets or tuples are converted to
    multiple keys so accessing any one of the items in the original
    list-like object returns the matching value

    md = MethodDispatcher({("foo", "bar"):"baz"})
    md["foo"] == "baz"

    A default value which can be set through the default attribute.
    """

    def __init__(self, items=()):
        # Using _dictEntries instead of directly assigning to self is about
        # twice as fast. Please do careful performance testing before changing
        # anything here.
        _dictEntries = []
        for name, value in items:
            if type(name) in (list, tuple, frozenset, set):
                for item in name:
                    _dictEntries.append((item, value))
            else:
                _dictEntries.append((name, value))
        dict.__init__(self, _dictEntries)
        self.default = None

    def __getitem__(self, key):
        return dict.get(self, key, self.default)


# Some utility functions to dal with weirdness around UCS2 vs UCS4
# python builds

def isSurrogatePair(data):
    return (len(data) == 2 and
            ord(data[0]) >= 0xD800 and ord(data[0]) <= 0xDBFF and
            ord(data[1]) >= 0xDC00 and ord(data[1]) <= 0xDFFF)


def surrogatePairToCodepoint(data):
    char_val = (0x10000 + (ord(data[0]) - 0xD800) * 0x400 +
                (ord(data[1]) - 0xDC00))
    return char_val

# Module Factory Factory (no, this isn't Java, I know)
# Here to stop this being duplicated all over the place.


def moduleFactoryFactory(factory):
    moduleCache = {}

    def moduleFactory(baseModule, *args, **kwargs):
        if isinstance(ModuleType.__name__, type("")):
            name = "_%s_factory" % baseModule.__name__
        else:
            name = b"_%s_factory" % baseModule.__name__

        if name in moduleCache:
            return moduleCache[name]
        else:
            mod = ModuleType(name)
            objs = factory(baseModule, *args, **kwargs)
            mod.__dict__.update(objs)
            moduleCache[name] = mod
            return mod

    return moduleFactory

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:37:39
root / linksafe
0755
__pycache__
--
March 03 2024 22:37:39
root / linksafe
0755
filters
--
March 03 2024 22:37:39
root / linksafe
0755
serializer
--
March 03 2024 22:37:39
root / linksafe
0755
treeadapters
--
March 03 2024 22:37:39
root / linksafe
0755
treebuilders
--
March 03 2024 22:37:39
root / linksafe
0755
treewalkers
--
March 03 2024 22:37:39
root / linksafe
0755
trie
--
March 03 2024 22:37:39
root / linksafe
0755
__init__.py
0.697 KB
November 13 2023 21:16:39
root / linksafe
0644
constants.py
85.299 KB
November 13 2023 21:16:39
root / linksafe
0644
html5parser.py
114.286 KB
November 13 2023 21:16:39
root / linksafe
0644
ihatexml.py
16.192 KB
November 13 2023 21:16:39
root / linksafe
0644
inputstream.py
29.918 KB
November 13 2023 21:16:39
root / linksafe
0644
sanitizer.py
16.043 KB
November 13 2023 21:16:39
root / linksafe
0644
tokenizer.py
75.126 KB
November 13 2023 21:16:39
root / linksafe
0644
utils.py
2.485 KB
November 13 2023 21:16:39
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF