SILENT KILLERPanel

Current Path: > > opt > alt > python34 > lib > python3.4 > site-packages > > pip > _vendor > html5lib > > trie >


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/alt/python34/lib/python3.4/site-packages//pip/_vendor/html5lib//trie/

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 212 bytes November 13 2023 21:20:25.
_base.py File 927 bytes November 13 2023 21:20:25.
datrie.py File 1178 bytes November 13 2023 21:20:25.
py.py File 1775 bytes November 13 2023 21:20:25.

Reading File: //opt/alt/python34/lib/python3.4/site-packages//pip/_vendor/html5lib//trie//_base.py

from __future__ import absolute_import, division, unicode_literals

from collections import Mapping


class Trie(Mapping):
    """Abstract base class for tries"""

    def keys(self, prefix=None):
        keys = super().keys()

        if prefix is None:
            return set(keys)

        # Python 2.6: no set comprehensions
        return set([x for x in keys if x.startswith(prefix)])

    def has_keys_with_prefix(self, prefix):
        for key in self.keys():
            if key.startswith(prefix):
                return True

        return False

    def longest_prefix(self, prefix):
        if prefix in self:
            return prefix

        for i in range(1, len(prefix) + 1):
            if prefix[:-i] in self:
                return prefix[:-i]

        raise KeyError(prefix)

    def longest_prefix_item(self, prefix):
        lprefix = self.longest_prefix(prefix)
        return (lprefix, self[lprefix])

SILENT KILLER Tool