Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__init__.py +3 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__main__.py +12 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/cacert.pem +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/core.py +76 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/base.py +12 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +916 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/base.py +417 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +239 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +343 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +392 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__init__.py +44 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/core.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/codec.py +112 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/compat.py +13 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/core.py +397 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/idnadata.py +2137 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/intranges.py +54 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/package_data.py +2 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/uts46data.py +0 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/cmdline.py +663 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/console.py +70 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/filters/__init__.py +937 -0
- env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/bbcode.py +108 -0
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__init__.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from .core import contents, where
|
2 |
+
|
3 |
+
__version__ = "2021.10.08"
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__main__.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import argparse
|
2 |
+
|
3 |
+
from pip._vendor.certifi import contents, where
|
4 |
+
|
5 |
+
parser = argparse.ArgumentParser()
|
6 |
+
parser.add_argument("-c", "--contents", action="store_true")
|
7 |
+
args = parser.parse_args()
|
8 |
+
|
9 |
+
if args.contents:
|
10 |
+
print(contents())
|
11 |
+
else:
|
12 |
+
print(where())
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (268 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-310.pyc
ADDED
Binary file (447 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-310.pyc
ADDED
Binary file (1.51 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/cacert.pem
ADDED
The diff for this file is too large to render.
See raw diff
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/certifi/core.py
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
"""
|
4 |
+
certifi.py
|
5 |
+
~~~~~~~~~~
|
6 |
+
|
7 |
+
This module returns the installation location of cacert.pem or its contents.
|
8 |
+
"""
|
9 |
+
import os
|
10 |
+
|
11 |
+
|
12 |
+
class _PipPatchedCertificate(Exception):
|
13 |
+
pass
|
14 |
+
|
15 |
+
|
16 |
+
DEBIAN_CA_CERTS_PATH = '/etc/ssl/certs/ca-certificates.crt'
|
17 |
+
|
18 |
+
try:
|
19 |
+
# Return a certificate file on disk for a standalone pip zipapp running in
|
20 |
+
# an isolated build environment to use. Passing --cert to the standalone
|
21 |
+
# pip does not work since requests calls where() unconditionally on import.
|
22 |
+
_PIP_STANDALONE_CERT = os.environ.get("_PIP_STANDALONE_CERT")
|
23 |
+
if _PIP_STANDALONE_CERT:
|
24 |
+
def where():
|
25 |
+
return _PIP_STANDALONE_CERT
|
26 |
+
raise _PipPatchedCertificate()
|
27 |
+
|
28 |
+
from importlib.resources import path as get_path, read_text
|
29 |
+
|
30 |
+
_CACERT_CTX = None
|
31 |
+
_CACERT_PATH = None
|
32 |
+
|
33 |
+
def where():
|
34 |
+
# This is slightly terrible, but we want to delay extracting the file
|
35 |
+
# in cases where we're inside of a zipimport situation until someone
|
36 |
+
# actually calls where(), but we don't want to re-extract the file
|
37 |
+
# on every call of where(), so we'll do it once then store it in a
|
38 |
+
# global variable.
|
39 |
+
global _CACERT_CTX
|
40 |
+
global _CACERT_PATH
|
41 |
+
if _CACERT_PATH is None:
|
42 |
+
# This is slightly janky, the importlib.resources API wants you to
|
43 |
+
# manage the cleanup of this file, so it doesn't actually return a
|
44 |
+
# path, it returns a context manager that will give you the path
|
45 |
+
# when you enter it and will do any cleanup when you leave it. In
|
46 |
+
# the common case of not needing a temporary file, it will just
|
47 |
+
# return the file system location and the __exit__() is a no-op.
|
48 |
+
#
|
49 |
+
# We also have to hold onto the actual context manager, because
|
50 |
+
# it will do the cleanup whenever it gets garbage collected, so
|
51 |
+
# we will also store that at the global level as well.
|
52 |
+
_CACERT_PATH = DEBIAN_CA_CERTS_PATH
|
53 |
+
|
54 |
+
return _CACERT_PATH
|
55 |
+
|
56 |
+
except _PipPatchedCertificate:
|
57 |
+
pass
|
58 |
+
|
59 |
+
except ImportError:
|
60 |
+
# This fallback will work for Python versions prior to 3.7 that lack the
|
61 |
+
# importlib.resources module but relies on the existing `where` function
|
62 |
+
# so won't address issues with environments like PyOxidizer that don't set
|
63 |
+
# __file__ on modules.
|
64 |
+
def read_text(_module, _path, encoding="ascii"):
|
65 |
+
with open(where(), "r", encoding=encoding) as data:
|
66 |
+
return data.read()
|
67 |
+
|
68 |
+
# If we don't have importlib.resources, then we will just do the old logic
|
69 |
+
# of assuming we're on the filesystem and munge the path directly.
|
70 |
+
def where():
|
71 |
+
return DEBIAN_CA_CERTS_PATH
|
72 |
+
|
73 |
+
|
74 |
+
def contents():
|
75 |
+
with open(where(), "r", encoding="ascii") as data:
|
76 |
+
return data.read()
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-310.pyc
ADDED
Binary file (161 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__init__.py
ADDED
File without changes
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (193 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-310.pyc
ADDED
Binary file (1.32 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-310.pyc
ADDED
Binary file (1.86 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-310.pyc
ADDED
Binary file (2.72 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-310.pyc
ADDED
Binary file (20 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-310.pyc
ADDED
Binary file (1.37 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
from . import base
|
4 |
+
|
5 |
+
from collections import OrderedDict
|
6 |
+
|
7 |
+
|
8 |
+
def _attr_key(attr):
|
9 |
+
"""Return an appropriate key for an attribute for sorting
|
10 |
+
|
11 |
+
Attributes have a namespace that can be either ``None`` or a string. We
|
12 |
+
can't compare the two because they're different types, so we convert
|
13 |
+
``None`` to an empty string first.
|
14 |
+
|
15 |
+
"""
|
16 |
+
return (attr[0][0] or ''), attr[0][1]
|
17 |
+
|
18 |
+
|
19 |
+
class Filter(base.Filter):
|
20 |
+
"""Alphabetizes attributes for elements"""
|
21 |
+
def __iter__(self):
|
22 |
+
for token in base.Filter.__iter__(self):
|
23 |
+
if token["type"] in ("StartTag", "EmptyTag"):
|
24 |
+
attrs = OrderedDict()
|
25 |
+
for name, value in sorted(token["data"].items(),
|
26 |
+
key=_attr_key):
|
27 |
+
attrs[name] = value
|
28 |
+
token["data"] = attrs
|
29 |
+
yield token
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/base.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
|
4 |
+
class Filter(object):
|
5 |
+
def __init__(self, source):
|
6 |
+
self.source = source
|
7 |
+
|
8 |
+
def __iter__(self):
|
9 |
+
return iter(self.source)
|
10 |
+
|
11 |
+
def __getattr__(self, name):
|
12 |
+
return getattr(self.source, name)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
from . import base
|
4 |
+
|
5 |
+
|
6 |
+
class Filter(base.Filter):
|
7 |
+
"""Injects ``<meta charset=ENCODING>`` tag into head of document"""
|
8 |
+
def __init__(self, source, encoding):
|
9 |
+
"""Creates a Filter
|
10 |
+
|
11 |
+
:arg source: the source token stream
|
12 |
+
|
13 |
+
:arg encoding: the encoding to set
|
14 |
+
|
15 |
+
"""
|
16 |
+
base.Filter.__init__(self, source)
|
17 |
+
self.encoding = encoding
|
18 |
+
|
19 |
+
def __iter__(self):
|
20 |
+
state = "pre_head"
|
21 |
+
meta_found = (self.encoding is None)
|
22 |
+
pending = []
|
23 |
+
|
24 |
+
for token in base.Filter.__iter__(self):
|
25 |
+
type = token["type"]
|
26 |
+
if type == "StartTag":
|
27 |
+
if token["name"].lower() == "head":
|
28 |
+
state = "in_head"
|
29 |
+
|
30 |
+
elif type == "EmptyTag":
|
31 |
+
if token["name"].lower() == "meta":
|
32 |
+
# replace charset with actual encoding
|
33 |
+
has_http_equiv_content_type = False
|
34 |
+
for (namespace, name), value in token["data"].items():
|
35 |
+
if namespace is not None:
|
36 |
+
continue
|
37 |
+
elif name.lower() == 'charset':
|
38 |
+
token["data"][(namespace, name)] = self.encoding
|
39 |
+
meta_found = True
|
40 |
+
break
|
41 |
+
elif name == 'http-equiv' and value.lower() == 'content-type':
|
42 |
+
has_http_equiv_content_type = True
|
43 |
+
else:
|
44 |
+
if has_http_equiv_content_type and (None, "content") in token["data"]:
|
45 |
+
token["data"][(None, "content")] = 'text/html; charset=%s' % self.encoding
|
46 |
+
meta_found = True
|
47 |
+
|
48 |
+
elif token["name"].lower() == "head" and not meta_found:
|
49 |
+
# insert meta into empty head
|
50 |
+
yield {"type": "StartTag", "name": "head",
|
51 |
+
"data": token["data"]}
|
52 |
+
yield {"type": "EmptyTag", "name": "meta",
|
53 |
+
"data": {(None, "charset"): self.encoding}}
|
54 |
+
yield {"type": "EndTag", "name": "head"}
|
55 |
+
meta_found = True
|
56 |
+
continue
|
57 |
+
|
58 |
+
elif type == "EndTag":
|
59 |
+
if token["name"].lower() == "head" and pending:
|
60 |
+
# insert meta into head (if necessary) and flush pending queue
|
61 |
+
yield pending.pop(0)
|
62 |
+
if not meta_found:
|
63 |
+
yield {"type": "EmptyTag", "name": "meta",
|
64 |
+
"data": {(None, "charset"): self.encoding}}
|
65 |
+
while pending:
|
66 |
+
yield pending.pop(0)
|
67 |
+
meta_found = True
|
68 |
+
state = "post_head"
|
69 |
+
|
70 |
+
if state == "in_head":
|
71 |
+
pending.append(token)
|
72 |
+
else:
|
73 |
+
yield token
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/lint.py
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
from pip._vendor.six import text_type
|
4 |
+
|
5 |
+
from . import base
|
6 |
+
from ..constants import namespaces, voidElements
|
7 |
+
|
8 |
+
from ..constants import spaceCharacters
|
9 |
+
spaceCharacters = "".join(spaceCharacters)
|
10 |
+
|
11 |
+
|
12 |
+
class Filter(base.Filter):
|
13 |
+
"""Lints the token stream for errors
|
14 |
+
|
15 |
+
If it finds any errors, it'll raise an ``AssertionError``.
|
16 |
+
|
17 |
+
"""
|
18 |
+
def __init__(self, source, require_matching_tags=True):
|
19 |
+
"""Creates a Filter
|
20 |
+
|
21 |
+
:arg source: the source token stream
|
22 |
+
|
23 |
+
:arg require_matching_tags: whether or not to require matching tags
|
24 |
+
|
25 |
+
"""
|
26 |
+
super(Filter, self).__init__(source)
|
27 |
+
self.require_matching_tags = require_matching_tags
|
28 |
+
|
29 |
+
def __iter__(self):
|
30 |
+
open_elements = []
|
31 |
+
for token in base.Filter.__iter__(self):
|
32 |
+
type = token["type"]
|
33 |
+
if type in ("StartTag", "EmptyTag"):
|
34 |
+
namespace = token["namespace"]
|
35 |
+
name = token["name"]
|
36 |
+
assert namespace is None or isinstance(namespace, text_type)
|
37 |
+
assert namespace != ""
|
38 |
+
assert isinstance(name, text_type)
|
39 |
+
assert name != ""
|
40 |
+
assert isinstance(token["data"], dict)
|
41 |
+
if (not namespace or namespace == namespaces["html"]) and name in voidElements:
|
42 |
+
assert type == "EmptyTag"
|
43 |
+
else:
|
44 |
+
assert type == "StartTag"
|
45 |
+
if type == "StartTag" and self.require_matching_tags:
|
46 |
+
open_elements.append((namespace, name))
|
47 |
+
for (namespace, name), value in token["data"].items():
|
48 |
+
assert namespace is None or isinstance(namespace, text_type)
|
49 |
+
assert namespace != ""
|
50 |
+
assert isinstance(name, text_type)
|
51 |
+
assert name != ""
|
52 |
+
assert isinstance(value, text_type)
|
53 |
+
|
54 |
+
elif type == "EndTag":
|
55 |
+
namespace = token["namespace"]
|
56 |
+
name = token["name"]
|
57 |
+
assert namespace is None or isinstance(namespace, text_type)
|
58 |
+
assert namespace != ""
|
59 |
+
assert isinstance(name, text_type)
|
60 |
+
assert name != ""
|
61 |
+
if (not namespace or namespace == namespaces["html"]) and name in voidElements:
|
62 |
+
assert False, "Void element reported as EndTag token: %(tag)s" % {"tag": name}
|
63 |
+
elif self.require_matching_tags:
|
64 |
+
start = open_elements.pop()
|
65 |
+
assert start == (namespace, name)
|
66 |
+
|
67 |
+
elif type == "Comment":
|
68 |
+
data = token["data"]
|
69 |
+
assert isinstance(data, text_type)
|
70 |
+
|
71 |
+
elif type in ("Characters", "SpaceCharacters"):
|
72 |
+
data = token["data"]
|
73 |
+
assert isinstance(data, text_type)
|
74 |
+
assert data != ""
|
75 |
+
if type == "SpaceCharacters":
|
76 |
+
assert data.strip(spaceCharacters) == ""
|
77 |
+
|
78 |
+
elif type == "Doctype":
|
79 |
+
name = token["name"]
|
80 |
+
assert name is None or isinstance(name, text_type)
|
81 |
+
assert token["publicId"] is None or isinstance(name, text_type)
|
82 |
+
assert token["systemId"] is None or isinstance(name, text_type)
|
83 |
+
|
84 |
+
elif type == "Entity":
|
85 |
+
assert isinstance(token["name"], text_type)
|
86 |
+
|
87 |
+
elif type == "SerializerError":
|
88 |
+
assert isinstance(token["data"], text_type)
|
89 |
+
|
90 |
+
else:
|
91 |
+
assert False, "Unknown token type: %(type)s" % {"type": type}
|
92 |
+
|
93 |
+
yield token
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/optionaltags.py
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
from . import base
|
4 |
+
|
5 |
+
|
6 |
+
class Filter(base.Filter):
|
7 |
+
"""Removes optional tags from the token stream"""
|
8 |
+
def slider(self):
|
9 |
+
previous1 = previous2 = None
|
10 |
+
for token in self.source:
|
11 |
+
if previous1 is not None:
|
12 |
+
yield previous2, previous1, token
|
13 |
+
previous2 = previous1
|
14 |
+
previous1 = token
|
15 |
+
if previous1 is not None:
|
16 |
+
yield previous2, previous1, None
|
17 |
+
|
18 |
+
def __iter__(self):
|
19 |
+
for previous, token, next in self.slider():
|
20 |
+
type = token["type"]
|
21 |
+
if type == "StartTag":
|
22 |
+
if (token["data"] or
|
23 |
+
not self.is_optional_start(token["name"], previous, next)):
|
24 |
+
yield token
|
25 |
+
elif type == "EndTag":
|
26 |
+
if not self.is_optional_end(token["name"], next):
|
27 |
+
yield token
|
28 |
+
else:
|
29 |
+
yield token
|
30 |
+
|
31 |
+
def is_optional_start(self, tagname, previous, next):
|
32 |
+
type = next and next["type"] or None
|
33 |
+
if tagname in 'html':
|
34 |
+
# An html element's start tag may be omitted if the first thing
|
35 |
+
# inside the html element is not a space character or a comment.
|
36 |
+
return type not in ("Comment", "SpaceCharacters")
|
37 |
+
elif tagname == 'head':
|
38 |
+
# A head element's start tag may be omitted if the first thing
|
39 |
+
# inside the head element is an element.
|
40 |
+
# XXX: we also omit the start tag if the head element is empty
|
41 |
+
if type in ("StartTag", "EmptyTag"):
|
42 |
+
return True
|
43 |
+
elif type == "EndTag":
|
44 |
+
return next["name"] == "head"
|
45 |
+
elif tagname == 'body':
|
46 |
+
# A body element's start tag may be omitted if the first thing
|
47 |
+
# inside the body element is not a space character or a comment,
|
48 |
+
# except if the first thing inside the body element is a script
|
49 |
+
# or style element and the node immediately preceding the body
|
50 |
+
# element is a head element whose end tag has been omitted.
|
51 |
+
if type in ("Comment", "SpaceCharacters"):
|
52 |
+
return False
|
53 |
+
elif type == "StartTag":
|
54 |
+
# XXX: we do not look at the preceding event, so we never omit
|
55 |
+
# the body element's start tag if it's followed by a script or
|
56 |
+
# a style element.
|
57 |
+
return next["name"] not in ('script', 'style')
|
58 |
+
else:
|
59 |
+
return True
|
60 |
+
elif tagname == 'colgroup':
|
61 |
+
# A colgroup element's start tag may be omitted if the first thing
|
62 |
+
# inside the colgroup element is a col element, and if the element
|
63 |
+
# is not immediately preceded by another colgroup element whose
|
64 |
+
# end tag has been omitted.
|
65 |
+
if type in ("StartTag", "EmptyTag"):
|
66 |
+
# XXX: we do not look at the preceding event, so instead we never
|
67 |
+
# omit the colgroup element's end tag when it is immediately
|
68 |
+
# followed by another colgroup element. See is_optional_end.
|
69 |
+
return next["name"] == "col"
|
70 |
+
else:
|
71 |
+
return False
|
72 |
+
elif tagname == 'tbody':
|
73 |
+
# A tbody element's start tag may be omitted if the first thing
|
74 |
+
# inside the tbody element is a tr element, and if the element is
|
75 |
+
# not immediately preceded by a tbody, thead, or tfoot element
|
76 |
+
# whose end tag has been omitted.
|
77 |
+
if type == "StartTag":
|
78 |
+
# omit the thead and tfoot elements' end tag when they are
|
79 |
+
# immediately followed by a tbody element. See is_optional_end.
|
80 |
+
if previous and previous['type'] == 'EndTag' and \
|
81 |
+
previous['name'] in ('tbody', 'thead', 'tfoot'):
|
82 |
+
return False
|
83 |
+
return next["name"] == 'tr'
|
84 |
+
else:
|
85 |
+
return False
|
86 |
+
return False
|
87 |
+
|
88 |
+
def is_optional_end(self, tagname, next):
|
89 |
+
type = next and next["type"] or None
|
90 |
+
if tagname in ('html', 'head', 'body'):
|
91 |
+
# An html element's end tag may be omitted if the html element
|
92 |
+
# is not immediately followed by a space character or a comment.
|
93 |
+
return type not in ("Comment", "SpaceCharacters")
|
94 |
+
elif tagname in ('li', 'optgroup', 'tr'):
|
95 |
+
# A li element's end tag may be omitted if the li element is
|
96 |
+
# immediately followed by another li element or if there is
|
97 |
+
# no more content in the parent element.
|
98 |
+
# An optgroup element's end tag may be omitted if the optgroup
|
99 |
+
# element is immediately followed by another optgroup element,
|
100 |
+
# or if there is no more content in the parent element.
|
101 |
+
# A tr element's end tag may be omitted if the tr element is
|
102 |
+
# immediately followed by another tr element, or if there is
|
103 |
+
# no more content in the parent element.
|
104 |
+
if type == "StartTag":
|
105 |
+
return next["name"] == tagname
|
106 |
+
else:
|
107 |
+
return type == "EndTag" or type is None
|
108 |
+
elif tagname in ('dt', 'dd'):
|
109 |
+
# A dt element's end tag may be omitted if the dt element is
|
110 |
+
# immediately followed by another dt element or a dd element.
|
111 |
+
# A dd element's end tag may be omitted if the dd element is
|
112 |
+
# immediately followed by another dd element or a dt element,
|
113 |
+
# or if there is no more content in the parent element.
|
114 |
+
if type == "StartTag":
|
115 |
+
return next["name"] in ('dt', 'dd')
|
116 |
+
elif tagname == 'dd':
|
117 |
+
return type == "EndTag" or type is None
|
118 |
+
else:
|
119 |
+
return False
|
120 |
+
elif tagname == 'p':
|
121 |
+
# A p element's end tag may be omitted if the p element is
|
122 |
+
# immediately followed by an address, article, aside,
|
123 |
+
# blockquote, datagrid, dialog, dir, div, dl, fieldset,
|
124 |
+
# footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu,
|
125 |
+
# nav, ol, p, pre, section, table, or ul, element, or if
|
126 |
+
# there is no more content in the parent element.
|
127 |
+
if type in ("StartTag", "EmptyTag"):
|
128 |
+
return next["name"] in ('address', 'article', 'aside',
|
129 |
+
'blockquote', 'datagrid', 'dialog',
|
130 |
+
'dir', 'div', 'dl', 'fieldset', 'footer',
|
131 |
+
'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
132 |
+
'header', 'hr', 'menu', 'nav', 'ol',
|
133 |
+
'p', 'pre', 'section', 'table', 'ul')
|
134 |
+
else:
|
135 |
+
return type == "EndTag" or type is None
|
136 |
+
elif tagname == 'option':
|
137 |
+
# An option element's end tag may be omitted if the option
|
138 |
+
# element is immediately followed by another option element,
|
139 |
+
# or if it is immediately followed by an <code>optgroup</code>
|
140 |
+
# element, or if there is no more content in the parent
|
141 |
+
# element.
|
142 |
+
if type == "StartTag":
|
143 |
+
return next["name"] in ('option', 'optgroup')
|
144 |
+
else:
|
145 |
+
return type == "EndTag" or type is None
|
146 |
+
elif tagname in ('rt', 'rp'):
|
147 |
+
# An rt element's end tag may be omitted if the rt element is
|
148 |
+
# immediately followed by an rt or rp element, or if there is
|
149 |
+
# no more content in the parent element.
|
150 |
+
# An rp element's end tag may be omitted if the rp element is
|
151 |
+
# immediately followed by an rt or rp element, or if there is
|
152 |
+
# no more content in the parent element.
|
153 |
+
if type == "StartTag":
|
154 |
+
return next["name"] in ('rt', 'rp')
|
155 |
+
else:
|
156 |
+
return type == "EndTag" or type is None
|
157 |
+
elif tagname == 'colgroup':
|
158 |
+
# A colgroup element's end tag may be omitted if the colgroup
|
159 |
+
# element is not immediately followed by a space character or
|
160 |
+
# a comment.
|
161 |
+
if type in ("Comment", "SpaceCharacters"):
|
162 |
+
return False
|
163 |
+
elif type == "StartTag":
|
164 |
+
# XXX: we also look for an immediately following colgroup
|
165 |
+
# element. See is_optional_start.
|
166 |
+
return next["name"] != 'colgroup'
|
167 |
+
else:
|
168 |
+
return True
|
169 |
+
elif tagname in ('thead', 'tbody'):
|
170 |
+
# A thead element's end tag may be omitted if the thead element
|
171 |
+
# is immediately followed by a tbody or tfoot element.
|
172 |
+
# A tbody element's end tag may be omitted if the tbody element
|
173 |
+
# is immediately followed by a tbody or tfoot element, or if
|
174 |
+
# there is no more content in the parent element.
|
175 |
+
# A tfoot element's end tag may be omitted if the tfoot element
|
176 |
+
# is immediately followed by a tbody element, or if there is no
|
177 |
+
# more content in the parent element.
|
178 |
+
# XXX: we never omit the end tag when the following element is
|
179 |
+
# a tbody. See is_optional_start.
|
180 |
+
if type == "StartTag":
|
181 |
+
return next["name"] in ['tbody', 'tfoot']
|
182 |
+
elif tagname == 'tbody':
|
183 |
+
return type == "EndTag" or type is None
|
184 |
+
else:
|
185 |
+
return False
|
186 |
+
elif tagname == 'tfoot':
|
187 |
+
# A tfoot element's end tag may be omitted if the tfoot element
|
188 |
+
# is immediately followed by a tbody element, or if there is no
|
189 |
+
# more content in the parent element.
|
190 |
+
# XXX: we never omit the end tag when the following element is
|
191 |
+
# a tbody. See is_optional_start.
|
192 |
+
if type == "StartTag":
|
193 |
+
return next["name"] == 'tbody'
|
194 |
+
else:
|
195 |
+
return type == "EndTag" or type is None
|
196 |
+
elif tagname in ('td', 'th'):
|
197 |
+
# A td element's end tag may be omitted if the td element is
|
198 |
+
# immediately followed by a td or th element, or if there is
|
199 |
+
# no more content in the parent element.
|
200 |
+
# A th element's end tag may be omitted if the th element is
|
201 |
+
# immediately followed by a td or th element, or if there is
|
202 |
+
# no more content in the parent element.
|
203 |
+
if type == "StartTag":
|
204 |
+
return next["name"] in ('td', 'th')
|
205 |
+
else:
|
206 |
+
return type == "EndTag" or type is None
|
207 |
+
return False
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Deprecated from html5lib 1.1.
|
2 |
+
|
3 |
+
See `here <https://github.com/html5lib/html5lib-python/issues/443>`_ for
|
4 |
+
information about its deprecation; `Bleach <https://github.com/mozilla/bleach>`_
|
5 |
+
is recommended as a replacement. Please let us know in the aforementioned issue
|
6 |
+
if Bleach is unsuitable for your needs.
|
7 |
+
|
8 |
+
"""
|
9 |
+
from __future__ import absolute_import, division, unicode_literals
|
10 |
+
|
11 |
+
import re
|
12 |
+
import warnings
|
13 |
+
from xml.sax.saxutils import escape, unescape
|
14 |
+
|
15 |
+
from pip._vendor.six.moves import urllib_parse as urlparse
|
16 |
+
|
17 |
+
from . import base
|
18 |
+
from ..constants import namespaces, prefixes
|
19 |
+
|
20 |
+
__all__ = ["Filter"]
|
21 |
+
|
22 |
+
|
23 |
+
_deprecation_msg = (
|
24 |
+
"html5lib's sanitizer is deprecated; see " +
|
25 |
+
"https://github.com/html5lib/html5lib-python/issues/443 and please let " +
|
26 |
+
"us know if Bleach is unsuitable for your needs"
|
27 |
+
)
|
28 |
+
|
29 |
+
warnings.warn(_deprecation_msg, DeprecationWarning)
|
30 |
+
|
31 |
+
allowed_elements = frozenset((
|
32 |
+
(namespaces['html'], 'a'),
|
33 |
+
(namespaces['html'], 'abbr'),
|
34 |
+
(namespaces['html'], 'acronym'),
|
35 |
+
(namespaces['html'], 'address'),
|
36 |
+
(namespaces['html'], 'area'),
|
37 |
+
(namespaces['html'], 'article'),
|
38 |
+
(namespaces['html'], 'aside'),
|
39 |
+
(namespaces['html'], 'audio'),
|
40 |
+
(namespaces['html'], 'b'),
|
41 |
+
(namespaces['html'], 'big'),
|
42 |
+
(namespaces['html'], 'blockquote'),
|
43 |
+
(namespaces['html'], 'br'),
|
44 |
+
(namespaces['html'], 'button'),
|
45 |
+
(namespaces['html'], 'canvas'),
|
46 |
+
(namespaces['html'], 'caption'),
|
47 |
+
(namespaces['html'], 'center'),
|
48 |
+
(namespaces['html'], 'cite'),
|
49 |
+
(namespaces['html'], 'code'),
|
50 |
+
(namespaces['html'], 'col'),
|
51 |
+
(namespaces['html'], 'colgroup'),
|
52 |
+
(namespaces['html'], 'command'),
|
53 |
+
(namespaces['html'], 'datagrid'),
|
54 |
+
(namespaces['html'], 'datalist'),
|
55 |
+
(namespaces['html'], 'dd'),
|
56 |
+
(namespaces['html'], 'del'),
|
57 |
+
(namespaces['html'], 'details'),
|
58 |
+
(namespaces['html'], 'dfn'),
|
59 |
+
(namespaces['html'], 'dialog'),
|
60 |
+
(namespaces['html'], 'dir'),
|
61 |
+
(namespaces['html'], 'div'),
|
62 |
+
(namespaces['html'], 'dl'),
|
63 |
+
(namespaces['html'], 'dt'),
|
64 |
+
(namespaces['html'], 'em'),
|
65 |
+
(namespaces['html'], 'event-source'),
|
66 |
+
(namespaces['html'], 'fieldset'),
|
67 |
+
(namespaces['html'], 'figcaption'),
|
68 |
+
(namespaces['html'], 'figure'),
|
69 |
+
(namespaces['html'], 'footer'),
|
70 |
+
(namespaces['html'], 'font'),
|
71 |
+
(namespaces['html'], 'form'),
|
72 |
+
(namespaces['html'], 'header'),
|
73 |
+
(namespaces['html'], 'h1'),
|
74 |
+
(namespaces['html'], 'h2'),
|
75 |
+
(namespaces['html'], 'h3'),
|
76 |
+
(namespaces['html'], 'h4'),
|
77 |
+
(namespaces['html'], 'h5'),
|
78 |
+
(namespaces['html'], 'h6'),
|
79 |
+
(namespaces['html'], 'hr'),
|
80 |
+
(namespaces['html'], 'i'),
|
81 |
+
(namespaces['html'], 'img'),
|
82 |
+
(namespaces['html'], 'input'),
|
83 |
+
(namespaces['html'], 'ins'),
|
84 |
+
(namespaces['html'], 'keygen'),
|
85 |
+
(namespaces['html'], 'kbd'),
|
86 |
+
(namespaces['html'], 'label'),
|
87 |
+
(namespaces['html'], 'legend'),
|
88 |
+
(namespaces['html'], 'li'),
|
89 |
+
(namespaces['html'], 'm'),
|
90 |
+
(namespaces['html'], 'map'),
|
91 |
+
(namespaces['html'], 'menu'),
|
92 |
+
(namespaces['html'], 'meter'),
|
93 |
+
(namespaces['html'], 'multicol'),
|
94 |
+
(namespaces['html'], 'nav'),
|
95 |
+
(namespaces['html'], 'nextid'),
|
96 |
+
(namespaces['html'], 'ol'),
|
97 |
+
(namespaces['html'], 'output'),
|
98 |
+
(namespaces['html'], 'optgroup'),
|
99 |
+
(namespaces['html'], 'option'),
|
100 |
+
(namespaces['html'], 'p'),
|
101 |
+
(namespaces['html'], 'pre'),
|
102 |
+
(namespaces['html'], 'progress'),
|
103 |
+
(namespaces['html'], 'q'),
|
104 |
+
(namespaces['html'], 's'),
|
105 |
+
(namespaces['html'], 'samp'),
|
106 |
+
(namespaces['html'], 'section'),
|
107 |
+
(namespaces['html'], 'select'),
|
108 |
+
(namespaces['html'], 'small'),
|
109 |
+
(namespaces['html'], 'sound'),
|
110 |
+
(namespaces['html'], 'source'),
|
111 |
+
(namespaces['html'], 'spacer'),
|
112 |
+
(namespaces['html'], 'span'),
|
113 |
+
(namespaces['html'], 'strike'),
|
114 |
+
(namespaces['html'], 'strong'),
|
115 |
+
(namespaces['html'], 'sub'),
|
116 |
+
(namespaces['html'], 'sup'),
|
117 |
+
(namespaces['html'], 'table'),
|
118 |
+
(namespaces['html'], 'tbody'),
|
119 |
+
(namespaces['html'], 'td'),
|
120 |
+
(namespaces['html'], 'textarea'),
|
121 |
+
(namespaces['html'], 'time'),
|
122 |
+
(namespaces['html'], 'tfoot'),
|
123 |
+
(namespaces['html'], 'th'),
|
124 |
+
(namespaces['html'], 'thead'),
|
125 |
+
(namespaces['html'], 'tr'),
|
126 |
+
(namespaces['html'], 'tt'),
|
127 |
+
(namespaces['html'], 'u'),
|
128 |
+
(namespaces['html'], 'ul'),
|
129 |
+
(namespaces['html'], 'var'),
|
130 |
+
(namespaces['html'], 'video'),
|
131 |
+
(namespaces['mathml'], 'maction'),
|
132 |
+
(namespaces['mathml'], 'math'),
|
133 |
+
(namespaces['mathml'], 'merror'),
|
134 |
+
(namespaces['mathml'], 'mfrac'),
|
135 |
+
(namespaces['mathml'], 'mi'),
|
136 |
+
(namespaces['mathml'], 'mmultiscripts'),
|
137 |
+
(namespaces['mathml'], 'mn'),
|
138 |
+
(namespaces['mathml'], 'mo'),
|
139 |
+
(namespaces['mathml'], 'mover'),
|
140 |
+
(namespaces['mathml'], 'mpadded'),
|
141 |
+
(namespaces['mathml'], 'mphantom'),
|
142 |
+
(namespaces['mathml'], 'mprescripts'),
|
143 |
+
(namespaces['mathml'], 'mroot'),
|
144 |
+
(namespaces['mathml'], 'mrow'),
|
145 |
+
(namespaces['mathml'], 'mspace'),
|
146 |
+
(namespaces['mathml'], 'msqrt'),
|
147 |
+
(namespaces['mathml'], 'mstyle'),
|
148 |
+
(namespaces['mathml'], 'msub'),
|
149 |
+
(namespaces['mathml'], 'msubsup'),
|
150 |
+
(namespaces['mathml'], 'msup'),
|
151 |
+
(namespaces['mathml'], 'mtable'),
|
152 |
+
(namespaces['mathml'], 'mtd'),
|
153 |
+
(namespaces['mathml'], 'mtext'),
|
154 |
+
(namespaces['mathml'], 'mtr'),
|
155 |
+
(namespaces['mathml'], 'munder'),
|
156 |
+
(namespaces['mathml'], 'munderover'),
|
157 |
+
(namespaces['mathml'], 'none'),
|
158 |
+
(namespaces['svg'], 'a'),
|
159 |
+
(namespaces['svg'], 'animate'),
|
160 |
+
(namespaces['svg'], 'animateColor'),
|
161 |
+
(namespaces['svg'], 'animateMotion'),
|
162 |
+
(namespaces['svg'], 'animateTransform'),
|
163 |
+
(namespaces['svg'], 'clipPath'),
|
164 |
+
(namespaces['svg'], 'circle'),
|
165 |
+
(namespaces['svg'], 'defs'),
|
166 |
+
(namespaces['svg'], 'desc'),
|
167 |
+
(namespaces['svg'], 'ellipse'),
|
168 |
+
(namespaces['svg'], 'font-face'),
|
169 |
+
(namespaces['svg'], 'font-face-name'),
|
170 |
+
(namespaces['svg'], 'font-face-src'),
|
171 |
+
(namespaces['svg'], 'g'),
|
172 |
+
(namespaces['svg'], 'glyph'),
|
173 |
+
(namespaces['svg'], 'hkern'),
|
174 |
+
(namespaces['svg'], 'linearGradient'),
|
175 |
+
(namespaces['svg'], 'line'),
|
176 |
+
(namespaces['svg'], 'marker'),
|
177 |
+
(namespaces['svg'], 'metadata'),
|
178 |
+
(namespaces['svg'], 'missing-glyph'),
|
179 |
+
(namespaces['svg'], 'mpath'),
|
180 |
+
(namespaces['svg'], 'path'),
|
181 |
+
(namespaces['svg'], 'polygon'),
|
182 |
+
(namespaces['svg'], 'polyline'),
|
183 |
+
(namespaces['svg'], 'radialGradient'),
|
184 |
+
(namespaces['svg'], 'rect'),
|
185 |
+
(namespaces['svg'], 'set'),
|
186 |
+
(namespaces['svg'], 'stop'),
|
187 |
+
(namespaces['svg'], 'svg'),
|
188 |
+
(namespaces['svg'], 'switch'),
|
189 |
+
(namespaces['svg'], 'text'),
|
190 |
+
(namespaces['svg'], 'title'),
|
191 |
+
(namespaces['svg'], 'tspan'),
|
192 |
+
(namespaces['svg'], 'use'),
|
193 |
+
))
|
194 |
+
|
195 |
+
allowed_attributes = frozenset((
|
196 |
+
# HTML attributes
|
197 |
+
(None, 'abbr'),
|
198 |
+
(None, 'accept'),
|
199 |
+
(None, 'accept-charset'),
|
200 |
+
(None, 'accesskey'),
|
201 |
+
(None, 'action'),
|
202 |
+
(None, 'align'),
|
203 |
+
(None, 'alt'),
|
204 |
+
(None, 'autocomplete'),
|
205 |
+
(None, 'autofocus'),
|
206 |
+
(None, 'axis'),
|
207 |
+
(None, 'background'),
|
208 |
+
(None, 'balance'),
|
209 |
+
(None, 'bgcolor'),
|
210 |
+
(None, 'bgproperties'),
|
211 |
+
(None, 'border'),
|
212 |
+
(None, 'bordercolor'),
|
213 |
+
(None, 'bordercolordark'),
|
214 |
+
(None, 'bordercolorlight'),
|
215 |
+
(None, 'bottompadding'),
|
216 |
+
(None, 'cellpadding'),
|
217 |
+
(None, 'cellspacing'),
|
218 |
+
(None, 'ch'),
|
219 |
+
(None, 'challenge'),
|
220 |
+
(None, 'char'),
|
221 |
+
(None, 'charoff'),
|
222 |
+
(None, 'choff'),
|
223 |
+
(None, 'charset'),
|
224 |
+
(None, 'checked'),
|
225 |
+
(None, 'cite'),
|
226 |
+
(None, 'class'),
|
227 |
+
(None, 'clear'),
|
228 |
+
(None, 'color'),
|
229 |
+
(None, 'cols'),
|
230 |
+
(None, 'colspan'),
|
231 |
+
(None, 'compact'),
|
232 |
+
(None, 'contenteditable'),
|
233 |
+
(None, 'controls'),
|
234 |
+
(None, 'coords'),
|
235 |
+
(None, 'data'),
|
236 |
+
(None, 'datafld'),
|
237 |
+
(None, 'datapagesize'),
|
238 |
+
(None, 'datasrc'),
|
239 |
+
(None, 'datetime'),
|
240 |
+
(None, 'default'),
|
241 |
+
(None, 'delay'),
|
242 |
+
(None, 'dir'),
|
243 |
+
(None, 'disabled'),
|
244 |
+
(None, 'draggable'),
|
245 |
+
(None, 'dynsrc'),
|
246 |
+
(None, 'enctype'),
|
247 |
+
(None, 'end'),
|
248 |
+
(None, 'face'),
|
249 |
+
(None, 'for'),
|
250 |
+
(None, 'form'),
|
251 |
+
(None, 'frame'),
|
252 |
+
(None, 'galleryimg'),
|
253 |
+
(None, 'gutter'),
|
254 |
+
(None, 'headers'),
|
255 |
+
(None, 'height'),
|
256 |
+
(None, 'hidefocus'),
|
257 |
+
(None, 'hidden'),
|
258 |
+
(None, 'high'),
|
259 |
+
(None, 'href'),
|
260 |
+
(None, 'hreflang'),
|
261 |
+
(None, 'hspace'),
|
262 |
+
(None, 'icon'),
|
263 |
+
(None, 'id'),
|
264 |
+
(None, 'inputmode'),
|
265 |
+
(None, 'ismap'),
|
266 |
+
(None, 'keytype'),
|
267 |
+
(None, 'label'),
|
268 |
+
(None, 'leftspacing'),
|
269 |
+
(None, 'lang'),
|
270 |
+
(None, 'list'),
|
271 |
+
(None, 'longdesc'),
|
272 |
+
(None, 'loop'),
|
273 |
+
(None, 'loopcount'),
|
274 |
+
(None, 'loopend'),
|
275 |
+
(None, 'loopstart'),
|
276 |
+
(None, 'low'),
|
277 |
+
(None, 'lowsrc'),
|
278 |
+
(None, 'max'),
|
279 |
+
(None, 'maxlength'),
|
280 |
+
(None, 'media'),
|
281 |
+
(None, 'method'),
|
282 |
+
(None, 'min'),
|
283 |
+
(None, 'multiple'),
|
284 |
+
(None, 'name'),
|
285 |
+
(None, 'nohref'),
|
286 |
+
(None, 'noshade'),
|
287 |
+
(None, 'nowrap'),
|
288 |
+
(None, 'open'),
|
289 |
+
(None, 'optimum'),
|
290 |
+
(None, 'pattern'),
|
291 |
+
(None, 'ping'),
|
292 |
+
(None, 'point-size'),
|
293 |
+
(None, 'poster'),
|
294 |
+
(None, 'pqg'),
|
295 |
+
(None, 'preload'),
|
296 |
+
(None, 'prompt'),
|
297 |
+
(None, 'radiogroup'),
|
298 |
+
(None, 'readonly'),
|
299 |
+
(None, 'rel'),
|
300 |
+
(None, 'repeat-max'),
|
301 |
+
(None, 'repeat-min'),
|
302 |
+
(None, 'replace'),
|
303 |
+
(None, 'required'),
|
304 |
+
(None, 'rev'),
|
305 |
+
(None, 'rightspacing'),
|
306 |
+
(None, 'rows'),
|
307 |
+
(None, 'rowspan'),
|
308 |
+
(None, 'rules'),
|
309 |
+
(None, 'scope'),
|
310 |
+
(None, 'selected'),
|
311 |
+
(None, 'shape'),
|
312 |
+
(None, 'size'),
|
313 |
+
(None, 'span'),
|
314 |
+
(None, 'src'),
|
315 |
+
(None, 'start'),
|
316 |
+
(None, 'step'),
|
317 |
+
(None, 'style'),
|
318 |
+
(None, 'summary'),
|
319 |
+
(None, 'suppress'),
|
320 |
+
(None, 'tabindex'),
|
321 |
+
(None, 'target'),
|
322 |
+
(None, 'template'),
|
323 |
+
(None, 'title'),
|
324 |
+
(None, 'toppadding'),
|
325 |
+
(None, 'type'),
|
326 |
+
(None, 'unselectable'),
|
327 |
+
(None, 'usemap'),
|
328 |
+
(None, 'urn'),
|
329 |
+
(None, 'valign'),
|
330 |
+
(None, 'value'),
|
331 |
+
(None, 'variable'),
|
332 |
+
(None, 'volume'),
|
333 |
+
(None, 'vspace'),
|
334 |
+
(None, 'vrml'),
|
335 |
+
(None, 'width'),
|
336 |
+
(None, 'wrap'),
|
337 |
+
(namespaces['xml'], 'lang'),
|
338 |
+
# MathML attributes
|
339 |
+
(None, 'actiontype'),
|
340 |
+
(None, 'align'),
|
341 |
+
(None, 'columnalign'),
|
342 |
+
(None, 'columnalign'),
|
343 |
+
(None, 'columnalign'),
|
344 |
+
(None, 'columnlines'),
|
345 |
+
(None, 'columnspacing'),
|
346 |
+
(None, 'columnspan'),
|
347 |
+
(None, 'depth'),
|
348 |
+
(None, 'display'),
|
349 |
+
(None, 'displaystyle'),
|
350 |
+
(None, 'equalcolumns'),
|
351 |
+
(None, 'equalrows'),
|
352 |
+
(None, 'fence'),
|
353 |
+
(None, 'fontstyle'),
|
354 |
+
(None, 'fontweight'),
|
355 |
+
(None, 'frame'),
|
356 |
+
(None, 'height'),
|
357 |
+
(None, 'linethickness'),
|
358 |
+
(None, 'lspace'),
|
359 |
+
(None, 'mathbackground'),
|
360 |
+
(None, 'mathcolor'),
|
361 |
+
(None, 'mathvariant'),
|
362 |
+
(None, 'mathvariant'),
|
363 |
+
(None, 'maxsize'),
|
364 |
+
(None, 'minsize'),
|
365 |
+
(None, 'other'),
|
366 |
+
(None, 'rowalign'),
|
367 |
+
(None, 'rowalign'),
|
368 |
+
(None, 'rowalign'),
|
369 |
+
(None, 'rowlines'),
|
370 |
+
(None, 'rowspacing'),
|
371 |
+
(None, 'rowspan'),
|
372 |
+
(None, 'rspace'),
|
373 |
+
(None, 'scriptlevel'),
|
374 |
+
(None, 'selection'),
|
375 |
+
(None, 'separator'),
|
376 |
+
(None, 'stretchy'),
|
377 |
+
(None, 'width'),
|
378 |
+
(None, 'width'),
|
379 |
+
(namespaces['xlink'], 'href'),
|
380 |
+
(namespaces['xlink'], 'show'),
|
381 |
+
(namespaces['xlink'], 'type'),
|
382 |
+
# SVG attributes
|
383 |
+
(None, 'accent-height'),
|
384 |
+
(None, 'accumulate'),
|
385 |
+
(None, 'additive'),
|
386 |
+
(None, 'alphabetic'),
|
387 |
+
(None, 'arabic-form'),
|
388 |
+
(None, 'ascent'),
|
389 |
+
(None, 'attributeName'),
|
390 |
+
(None, 'attributeType'),
|
391 |
+
(None, 'baseProfile'),
|
392 |
+
(None, 'bbox'),
|
393 |
+
(None, 'begin'),
|
394 |
+
(None, 'by'),
|
395 |
+
(None, 'calcMode'),
|
396 |
+
(None, 'cap-height'),
|
397 |
+
(None, 'class'),
|
398 |
+
(None, 'clip-path'),
|
399 |
+
(None, 'color'),
|
400 |
+
(None, 'color-rendering'),
|
401 |
+
(None, 'content'),
|
402 |
+
(None, 'cx'),
|
403 |
+
(None, 'cy'),
|
404 |
+
(None, 'd'),
|
405 |
+
(None, 'dx'),
|
406 |
+
(None, 'dy'),
|
407 |
+
(None, 'descent'),
|
408 |
+
(None, 'display'),
|
409 |
+
(None, 'dur'),
|
410 |
+
(None, 'end'),
|
411 |
+
(None, 'fill'),
|
412 |
+
(None, 'fill-opacity'),
|
413 |
+
(None, 'fill-rule'),
|
414 |
+
(None, 'font-family'),
|
415 |
+
(None, 'font-size'),
|
416 |
+
(None, 'font-stretch'),
|
417 |
+
(None, 'font-style'),
|
418 |
+
(None, 'font-variant'),
|
419 |
+
(None, 'font-weight'),
|
420 |
+
(None, 'from'),
|
421 |
+
(None, 'fx'),
|
422 |
+
(None, 'fy'),
|
423 |
+
(None, 'g1'),
|
424 |
+
(None, 'g2'),
|
425 |
+
(None, 'glyph-name'),
|
426 |
+
(None, 'gradientUnits'),
|
427 |
+
(None, 'hanging'),
|
428 |
+
(None, 'height'),
|
429 |
+
(None, 'horiz-adv-x'),
|
430 |
+
(None, 'horiz-origin-x'),
|
431 |
+
(None, 'id'),
|
432 |
+
(None, 'ideographic'),
|
433 |
+
(None, 'k'),
|
434 |
+
(None, 'keyPoints'),
|
435 |
+
(None, 'keySplines'),
|
436 |
+
(None, 'keyTimes'),
|
437 |
+
(None, 'lang'),
|
438 |
+
(None, 'marker-end'),
|
439 |
+
(None, 'marker-mid'),
|
440 |
+
(None, 'marker-start'),
|
441 |
+
(None, 'markerHeight'),
|
442 |
+
(None, 'markerUnits'),
|
443 |
+
(None, 'markerWidth'),
|
444 |
+
(None, 'mathematical'),
|
445 |
+
(None, 'max'),
|
446 |
+
(None, 'min'),
|
447 |
+
(None, 'name'),
|
448 |
+
(None, 'offset'),
|
449 |
+
(None, 'opacity'),
|
450 |
+
(None, 'orient'),
|
451 |
+
(None, 'origin'),
|
452 |
+
(None, 'overline-position'),
|
453 |
+
(None, 'overline-thickness'),
|
454 |
+
(None, 'panose-1'),
|
455 |
+
(None, 'path'),
|
456 |
+
(None, 'pathLength'),
|
457 |
+
(None, 'points'),
|
458 |
+
(None, 'preserveAspectRatio'),
|
459 |
+
(None, 'r'),
|
460 |
+
(None, 'refX'),
|
461 |
+
(None, 'refY'),
|
462 |
+
(None, 'repeatCount'),
|
463 |
+
(None, 'repeatDur'),
|
464 |
+
(None, 'requiredExtensions'),
|
465 |
+
(None, 'requiredFeatures'),
|
466 |
+
(None, 'restart'),
|
467 |
+
(None, 'rotate'),
|
468 |
+
(None, 'rx'),
|
469 |
+
(None, 'ry'),
|
470 |
+
(None, 'slope'),
|
471 |
+
(None, 'stemh'),
|
472 |
+
(None, 'stemv'),
|
473 |
+
(None, 'stop-color'),
|
474 |
+
(None, 'stop-opacity'),
|
475 |
+
(None, 'strikethrough-position'),
|
476 |
+
(None, 'strikethrough-thickness'),
|
477 |
+
(None, 'stroke'),
|
478 |
+
(None, 'stroke-dasharray'),
|
479 |
+
(None, 'stroke-dashoffset'),
|
480 |
+
(None, 'stroke-linecap'),
|
481 |
+
(None, 'stroke-linejoin'),
|
482 |
+
(None, 'stroke-miterlimit'),
|
483 |
+
(None, 'stroke-opacity'),
|
484 |
+
(None, 'stroke-width'),
|
485 |
+
(None, 'systemLanguage'),
|
486 |
+
(None, 'target'),
|
487 |
+
(None, 'text-anchor'),
|
488 |
+
(None, 'to'),
|
489 |
+
(None, 'transform'),
|
490 |
+
(None, 'type'),
|
491 |
+
(None, 'u1'),
|
492 |
+
(None, 'u2'),
|
493 |
+
(None, 'underline-position'),
|
494 |
+
(None, 'underline-thickness'),
|
495 |
+
(None, 'unicode'),
|
496 |
+
(None, 'unicode-range'),
|
497 |
+
(None, 'units-per-em'),
|
498 |
+
(None, 'values'),
|
499 |
+
(None, 'version'),
|
500 |
+
(None, 'viewBox'),
|
501 |
+
(None, 'visibility'),
|
502 |
+
(None, 'width'),
|
503 |
+
(None, 'widths'),
|
504 |
+
(None, 'x'),
|
505 |
+
(None, 'x-height'),
|
506 |
+
(None, 'x1'),
|
507 |
+
(None, 'x2'),
|
508 |
+
(namespaces['xlink'], 'actuate'),
|
509 |
+
(namespaces['xlink'], 'arcrole'),
|
510 |
+
(namespaces['xlink'], 'href'),
|
511 |
+
(namespaces['xlink'], 'role'),
|
512 |
+
(namespaces['xlink'], 'show'),
|
513 |
+
(namespaces['xlink'], 'title'),
|
514 |
+
(namespaces['xlink'], 'type'),
|
515 |
+
(namespaces['xml'], 'base'),
|
516 |
+
(namespaces['xml'], 'lang'),
|
517 |
+
(namespaces['xml'], 'space'),
|
518 |
+
(None, 'y'),
|
519 |
+
(None, 'y1'),
|
520 |
+
(None, 'y2'),
|
521 |
+
(None, 'zoomAndPan'),
|
522 |
+
))
|
523 |
+
|
524 |
+
attr_val_is_uri = frozenset((
|
525 |
+
(None, 'href'),
|
526 |
+
(None, 'src'),
|
527 |
+
(None, 'cite'),
|
528 |
+
(None, 'action'),
|
529 |
+
(None, 'longdesc'),
|
530 |
+
(None, 'poster'),
|
531 |
+
(None, 'background'),
|
532 |
+
(None, 'datasrc'),
|
533 |
+
(None, 'dynsrc'),
|
534 |
+
(None, 'lowsrc'),
|
535 |
+
(None, 'ping'),
|
536 |
+
(namespaces['xlink'], 'href'),
|
537 |
+
(namespaces['xml'], 'base'),
|
538 |
+
))
|
539 |
+
|
540 |
+
svg_attr_val_allows_ref = frozenset((
|
541 |
+
(None, 'clip-path'),
|
542 |
+
(None, 'color-profile'),
|
543 |
+
(None, 'cursor'),
|
544 |
+
(None, 'fill'),
|
545 |
+
(None, 'filter'),
|
546 |
+
(None, 'marker'),
|
547 |
+
(None, 'marker-start'),
|
548 |
+
(None, 'marker-mid'),
|
549 |
+
(None, 'marker-end'),
|
550 |
+
(None, 'mask'),
|
551 |
+
(None, 'stroke'),
|
552 |
+
))
|
553 |
+
|
554 |
+
svg_allow_local_href = frozenset((
|
555 |
+
(None, 'altGlyph'),
|
556 |
+
(None, 'animate'),
|
557 |
+
(None, 'animateColor'),
|
558 |
+
(None, 'animateMotion'),
|
559 |
+
(None, 'animateTransform'),
|
560 |
+
(None, 'cursor'),
|
561 |
+
(None, 'feImage'),
|
562 |
+
(None, 'filter'),
|
563 |
+
(None, 'linearGradient'),
|
564 |
+
(None, 'pattern'),
|
565 |
+
(None, 'radialGradient'),
|
566 |
+
(None, 'textpath'),
|
567 |
+
(None, 'tref'),
|
568 |
+
(None, 'set'),
|
569 |
+
(None, 'use')
|
570 |
+
))
|
571 |
+
|
572 |
+
allowed_css_properties = frozenset((
|
573 |
+
'azimuth',
|
574 |
+
'background-color',
|
575 |
+
'border-bottom-color',
|
576 |
+
'border-collapse',
|
577 |
+
'border-color',
|
578 |
+
'border-left-color',
|
579 |
+
'border-right-color',
|
580 |
+
'border-top-color',
|
581 |
+
'clear',
|
582 |
+
'color',
|
583 |
+
'cursor',
|
584 |
+
'direction',
|
585 |
+
'display',
|
586 |
+
'elevation',
|
587 |
+
'float',
|
588 |
+
'font',
|
589 |
+
'font-family',
|
590 |
+
'font-size',
|
591 |
+
'font-style',
|
592 |
+
'font-variant',
|
593 |
+
'font-weight',
|
594 |
+
'height',
|
595 |
+
'letter-spacing',
|
596 |
+
'line-height',
|
597 |
+
'overflow',
|
598 |
+
'pause',
|
599 |
+
'pause-after',
|
600 |
+
'pause-before',
|
601 |
+
'pitch',
|
602 |
+
'pitch-range',
|
603 |
+
'richness',
|
604 |
+
'speak',
|
605 |
+
'speak-header',
|
606 |
+
'speak-numeral',
|
607 |
+
'speak-punctuation',
|
608 |
+
'speech-rate',
|
609 |
+
'stress',
|
610 |
+
'text-align',
|
611 |
+
'text-decoration',
|
612 |
+
'text-indent',
|
613 |
+
'unicode-bidi',
|
614 |
+
'vertical-align',
|
615 |
+
'voice-family',
|
616 |
+
'volume',
|
617 |
+
'white-space',
|
618 |
+
'width',
|
619 |
+
))
|
620 |
+
|
621 |
+
allowed_css_keywords = frozenset((
|
622 |
+
'auto',
|
623 |
+
'aqua',
|
624 |
+
'black',
|
625 |
+
'block',
|
626 |
+
'blue',
|
627 |
+
'bold',
|
628 |
+
'both',
|
629 |
+
'bottom',
|
630 |
+
'brown',
|
631 |
+
'center',
|
632 |
+
'collapse',
|
633 |
+
'dashed',
|
634 |
+
'dotted',
|
635 |
+
'fuchsia',
|
636 |
+
'gray',
|
637 |
+
'green',
|
638 |
+
'!important',
|
639 |
+
'italic',
|
640 |
+
'left',
|
641 |
+
'lime',
|
642 |
+
'maroon',
|
643 |
+
'medium',
|
644 |
+
'none',
|
645 |
+
'navy',
|
646 |
+
'normal',
|
647 |
+
'nowrap',
|
648 |
+
'olive',
|
649 |
+
'pointer',
|
650 |
+
'purple',
|
651 |
+
'red',
|
652 |
+
'right',
|
653 |
+
'solid',
|
654 |
+
'silver',
|
655 |
+
'teal',
|
656 |
+
'top',
|
657 |
+
'transparent',
|
658 |
+
'underline',
|
659 |
+
'white',
|
660 |
+
'yellow',
|
661 |
+
))
|
662 |
+
|
663 |
+
allowed_svg_properties = frozenset((
|
664 |
+
'fill',
|
665 |
+
'fill-opacity',
|
666 |
+
'fill-rule',
|
667 |
+
'stroke',
|
668 |
+
'stroke-width',
|
669 |
+
'stroke-linecap',
|
670 |
+
'stroke-linejoin',
|
671 |
+
'stroke-opacity',
|
672 |
+
))
|
673 |
+
|
674 |
+
allowed_protocols = frozenset((
|
675 |
+
'ed2k',
|
676 |
+
'ftp',
|
677 |
+
'http',
|
678 |
+
'https',
|
679 |
+
'irc',
|
680 |
+
'mailto',
|
681 |
+
'news',
|
682 |
+
'gopher',
|
683 |
+
'nntp',
|
684 |
+
'telnet',
|
685 |
+
'webcal',
|
686 |
+
'xmpp',
|
687 |
+
'callto',
|
688 |
+
'feed',
|
689 |
+
'urn',
|
690 |
+
'aim',
|
691 |
+
'rsync',
|
692 |
+
'tag',
|
693 |
+
'ssh',
|
694 |
+
'sftp',
|
695 |
+
'rtsp',
|
696 |
+
'afs',
|
697 |
+
'data',
|
698 |
+
))
|
699 |
+
|
700 |
+
allowed_content_types = frozenset((
|
701 |
+
'image/png',
|
702 |
+
'image/jpeg',
|
703 |
+
'image/gif',
|
704 |
+
'image/webp',
|
705 |
+
'image/bmp',
|
706 |
+
'text/plain',
|
707 |
+
))
|
708 |
+
|
709 |
+
|
710 |
+
data_content_type = re.compile(r'''
|
711 |
+
^
|
712 |
+
# Match a content type <application>/<type>
|
713 |
+
(?P<content_type>[-a-zA-Z0-9.]+/[-a-zA-Z0-9.]+)
|
714 |
+
# Match any character set and encoding
|
715 |
+
(?:(?:;charset=(?:[-a-zA-Z0-9]+)(?:;(?:base64))?)
|
716 |
+
|(?:;(?:base64))?(?:;charset=(?:[-a-zA-Z0-9]+))?)
|
717 |
+
# Assume the rest is data
|
718 |
+
,.*
|
719 |
+
$
|
720 |
+
''',
|
721 |
+
re.VERBOSE)
|
722 |
+
|
723 |
+
|
724 |
+
class Filter(base.Filter):
|
725 |
+
"""Sanitizes token stream of XHTML+MathML+SVG and of inline style attributes"""
|
726 |
+
def __init__(self,
|
727 |
+
source,
|
728 |
+
allowed_elements=allowed_elements,
|
729 |
+
allowed_attributes=allowed_attributes,
|
730 |
+
allowed_css_properties=allowed_css_properties,
|
731 |
+
allowed_css_keywords=allowed_css_keywords,
|
732 |
+
allowed_svg_properties=allowed_svg_properties,
|
733 |
+
allowed_protocols=allowed_protocols,
|
734 |
+
allowed_content_types=allowed_content_types,
|
735 |
+
attr_val_is_uri=attr_val_is_uri,
|
736 |
+
svg_attr_val_allows_ref=svg_attr_val_allows_ref,
|
737 |
+
svg_allow_local_href=svg_allow_local_href):
|
738 |
+
"""Creates a Filter
|
739 |
+
|
740 |
+
:arg allowed_elements: set of elements to allow--everything else will
|
741 |
+
be escaped
|
742 |
+
|
743 |
+
:arg allowed_attributes: set of attributes to allow in
|
744 |
+
elements--everything else will be stripped
|
745 |
+
|
746 |
+
:arg allowed_css_properties: set of CSS properties to allow--everything
|
747 |
+
else will be stripped
|
748 |
+
|
749 |
+
:arg allowed_css_keywords: set of CSS keywords to allow--everything
|
750 |
+
else will be stripped
|
751 |
+
|
752 |
+
:arg allowed_svg_properties: set of SVG properties to allow--everything
|
753 |
+
else will be removed
|
754 |
+
|
755 |
+
:arg allowed_protocols: set of allowed protocols for URIs
|
756 |
+
|
757 |
+
:arg allowed_content_types: set of allowed content types for ``data`` URIs.
|
758 |
+
|
759 |
+
:arg attr_val_is_uri: set of attributes that have URI values--values
|
760 |
+
that have a scheme not listed in ``allowed_protocols`` are removed
|
761 |
+
|
762 |
+
:arg svg_attr_val_allows_ref: set of SVG attributes that can have
|
763 |
+
references
|
764 |
+
|
765 |
+
:arg svg_allow_local_href: set of SVG elements that can have local
|
766 |
+
hrefs--these are removed
|
767 |
+
|
768 |
+
"""
|
769 |
+
super(Filter, self).__init__(source)
|
770 |
+
|
771 |
+
warnings.warn(_deprecation_msg, DeprecationWarning)
|
772 |
+
|
773 |
+
self.allowed_elements = allowed_elements
|
774 |
+
self.allowed_attributes = allowed_attributes
|
775 |
+
self.allowed_css_properties = allowed_css_properties
|
776 |
+
self.allowed_css_keywords = allowed_css_keywords
|
777 |
+
self.allowed_svg_properties = allowed_svg_properties
|
778 |
+
self.allowed_protocols = allowed_protocols
|
779 |
+
self.allowed_content_types = allowed_content_types
|
780 |
+
self.attr_val_is_uri = attr_val_is_uri
|
781 |
+
self.svg_attr_val_allows_ref = svg_attr_val_allows_ref
|
782 |
+
self.svg_allow_local_href = svg_allow_local_href
|
783 |
+
|
784 |
+
def __iter__(self):
|
785 |
+
for token in base.Filter.__iter__(self):
|
786 |
+
token = self.sanitize_token(token)
|
787 |
+
if token:
|
788 |
+
yield token
|
789 |
+
|
790 |
+
# Sanitize the +html+, escaping all elements not in ALLOWED_ELEMENTS, and
|
791 |
+
# stripping out all attributes not in ALLOWED_ATTRIBUTES. Style attributes
|
792 |
+
# are parsed, and a restricted set, specified by ALLOWED_CSS_PROPERTIES and
|
793 |
+
# ALLOWED_CSS_KEYWORDS, are allowed through. attributes in ATTR_VAL_IS_URI
|
794 |
+
# are scanned, and only URI schemes specified in ALLOWED_PROTOCOLS are
|
795 |
+
# allowed.
|
796 |
+
#
|
797 |
+
# sanitize_html('<script> do_nasty_stuff() </script>')
|
798 |
+
# => <script> do_nasty_stuff() </script>
|
799 |
+
# sanitize_html('<a href="javascript: sucker();">Click here for $100</a>')
|
800 |
+
# => <a>Click here for $100</a>
|
801 |
+
def sanitize_token(self, token):
|
802 |
+
|
803 |
+
# accommodate filters which use token_type differently
|
804 |
+
token_type = token["type"]
|
805 |
+
if token_type in ("StartTag", "EndTag", "EmptyTag"):
|
806 |
+
name = token["name"]
|
807 |
+
namespace = token["namespace"]
|
808 |
+
if ((namespace, name) in self.allowed_elements or
|
809 |
+
(namespace is None and
|
810 |
+
(namespaces["html"], name) in self.allowed_elements)):
|
811 |
+
return self.allowed_token(token)
|
812 |
+
else:
|
813 |
+
return self.disallowed_token(token)
|
814 |
+
elif token_type == "Comment":
|
815 |
+
pass
|
816 |
+
else:
|
817 |
+
return token
|
818 |
+
|
819 |
+
def allowed_token(self, token):
|
820 |
+
if "data" in token:
|
821 |
+
attrs = token["data"]
|
822 |
+
attr_names = set(attrs.keys())
|
823 |
+
|
824 |
+
# Remove forbidden attributes
|
825 |
+
for to_remove in (attr_names - self.allowed_attributes):
|
826 |
+
del token["data"][to_remove]
|
827 |
+
attr_names.remove(to_remove)
|
828 |
+
|
829 |
+
# Remove attributes with disallowed URL values
|
830 |
+
for attr in (attr_names & self.attr_val_is_uri):
|
831 |
+
assert attr in attrs
|
832 |
+
# I don't have a clue where this regexp comes from or why it matches those
|
833 |
+
# characters, nor why we call unescape. I just know it's always been here.
|
834 |
+
# Should you be worried by this comment in a sanitizer? Yes. On the other hand, all
|
835 |
+
# this will do is remove *more* than it otherwise would.
|
836 |
+
val_unescaped = re.sub("[`\x00-\x20\x7f-\xa0\\s]+", '',
|
837 |
+
unescape(attrs[attr])).lower()
|
838 |
+
# remove replacement characters from unescaped characters
|
839 |
+
val_unescaped = val_unescaped.replace("\ufffd", "")
|
840 |
+
try:
|
841 |
+
uri = urlparse.urlparse(val_unescaped)
|
842 |
+
except ValueError:
|
843 |
+
uri = None
|
844 |
+
del attrs[attr]
|
845 |
+
if uri and uri.scheme:
|
846 |
+
if uri.scheme not in self.allowed_protocols:
|
847 |
+
del attrs[attr]
|
848 |
+
if uri.scheme == 'data':
|
849 |
+
m = data_content_type.match(uri.path)
|
850 |
+
if not m:
|
851 |
+
del attrs[attr]
|
852 |
+
elif m.group('content_type') not in self.allowed_content_types:
|
853 |
+
del attrs[attr]
|
854 |
+
|
855 |
+
for attr in self.svg_attr_val_allows_ref:
|
856 |
+
if attr in attrs:
|
857 |
+
attrs[attr] = re.sub(r'url\s*\(\s*[^#\s][^)]+?\)',
|
858 |
+
' ',
|
859 |
+
unescape(attrs[attr]))
|
860 |
+
if (token["name"] in self.svg_allow_local_href and
|
861 |
+
(namespaces['xlink'], 'href') in attrs and re.search(r'^\s*[^#\s].*',
|
862 |
+
attrs[(namespaces['xlink'], 'href')])):
|
863 |
+
del attrs[(namespaces['xlink'], 'href')]
|
864 |
+
if (None, 'style') in attrs:
|
865 |
+
attrs[(None, 'style')] = self.sanitize_css(attrs[(None, 'style')])
|
866 |
+
token["data"] = attrs
|
867 |
+
return token
|
868 |
+
|
869 |
+
def disallowed_token(self, token):
|
870 |
+
token_type = token["type"]
|
871 |
+
if token_type == "EndTag":
|
872 |
+
token["data"] = "</%s>" % token["name"]
|
873 |
+
elif token["data"]:
|
874 |
+
assert token_type in ("StartTag", "EmptyTag")
|
875 |
+
attrs = []
|
876 |
+
for (ns, name), v in token["data"].items():
|
877 |
+
attrs.append(' %s="%s"' % (name if ns is None else "%s:%s" % (prefixes[ns], name), escape(v)))
|
878 |
+
token["data"] = "<%s%s>" % (token["name"], ''.join(attrs))
|
879 |
+
else:
|
880 |
+
token["data"] = "<%s>" % token["name"]
|
881 |
+
if token.get("selfClosing"):
|
882 |
+
token["data"] = token["data"][:-1] + "/>"
|
883 |
+
|
884 |
+
token["type"] = "Characters"
|
885 |
+
|
886 |
+
del token["name"]
|
887 |
+
return token
|
888 |
+
|
889 |
+
def sanitize_css(self, style):
|
890 |
+
# disallow urls
|
891 |
+
style = re.compile(r'url\s*\(\s*[^\s)]+?\s*\)\s*').sub(' ', style)
|
892 |
+
|
893 |
+
# gauntlet
|
894 |
+
if not re.match(r"""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style):
|
895 |
+
return ''
|
896 |
+
if not re.match(r"^\s*([-\w]+\s*:[^:;]*(;\s*|$))*$", style):
|
897 |
+
return ''
|
898 |
+
|
899 |
+
clean = []
|
900 |
+
for prop, value in re.findall(r"([-\w]+)\s*:\s*([^:;]*)", style):
|
901 |
+
if not value:
|
902 |
+
continue
|
903 |
+
if prop.lower() in self.allowed_css_properties:
|
904 |
+
clean.append(prop + ': ' + value + ';')
|
905 |
+
elif prop.split('-')[0].lower() in ['background', 'border', 'margin',
|
906 |
+
'padding']:
|
907 |
+
for keyword in value.split():
|
908 |
+
if keyword not in self.allowed_css_keywords and \
|
909 |
+
not re.match(r"^(#[0-9a-fA-F]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword): # noqa
|
910 |
+
break
|
911 |
+
else:
|
912 |
+
clean.append(prop + ': ' + value + ';')
|
913 |
+
elif prop.lower() in self.allowed_svg_properties:
|
914 |
+
clean.append(prop + ': ' + value + ';')
|
915 |
+
|
916 |
+
return ' '.join(clean)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/whitespace.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
import re
|
4 |
+
|
5 |
+
from . import base
|
6 |
+
from ..constants import rcdataElements, spaceCharacters
|
7 |
+
spaceCharacters = "".join(spaceCharacters)
|
8 |
+
|
9 |
+
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
|
10 |
+
|
11 |
+
|
12 |
+
class Filter(base.Filter):
|
13 |
+
"""Collapses whitespace except in pre, textarea, and script elements"""
|
14 |
+
spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements))
|
15 |
+
|
16 |
+
def __iter__(self):
|
17 |
+
preserve = 0
|
18 |
+
for token in base.Filter.__iter__(self):
|
19 |
+
type = token["type"]
|
20 |
+
if type == "StartTag" \
|
21 |
+
and (preserve or token["name"] in self.spacePreserveElements):
|
22 |
+
preserve += 1
|
23 |
+
|
24 |
+
elif type == "EndTag" and preserve:
|
25 |
+
preserve -= 1
|
26 |
+
|
27 |
+
elif not preserve and type == "SpaceCharacters" and token["data"]:
|
28 |
+
# Test on token["data"] above to not introduce spaces where there were not
|
29 |
+
token["data"] = " "
|
30 |
+
|
31 |
+
elif not preserve and type == "Characters":
|
32 |
+
token["data"] = collapse_spaces(token["data"])
|
33 |
+
|
34 |
+
yield token
|
35 |
+
|
36 |
+
|
37 |
+
def collapse_spaces(text):
|
38 |
+
return SPACES_REGEX.sub(' ', text)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""A collection of modules for building different kinds of trees from HTML
|
2 |
+
documents.
|
3 |
+
|
4 |
+
To create a treebuilder for a new type of tree, you need to do
|
5 |
+
implement several things:
|
6 |
+
|
7 |
+
1. A set of classes for various types of elements: Document, Doctype, Comment,
|
8 |
+
Element. These must implement the interface of ``base.treebuilders.Node``
|
9 |
+
(although comment nodes have a different signature for their constructor,
|
10 |
+
see ``treebuilders.etree.Comment``) Textual content may also be implemented
|
11 |
+
as another node type, or not, as your tree implementation requires.
|
12 |
+
|
13 |
+
2. A treebuilder object (called ``TreeBuilder`` by convention) that inherits
|
14 |
+
from ``treebuilders.base.TreeBuilder``. This has 4 required attributes:
|
15 |
+
|
16 |
+
* ``documentClass`` - the class to use for the bottommost node of a document
|
17 |
+
* ``elementClass`` - the class to use for HTML Elements
|
18 |
+
* ``commentClass`` - the class to use for comments
|
19 |
+
* ``doctypeClass`` - the class to use for doctypes
|
20 |
+
|
21 |
+
It also has one required method:
|
22 |
+
|
23 |
+
* ``getDocument`` - Returns the root node of the complete document tree
|
24 |
+
|
25 |
+
3. If you wish to run the unit tests, you must also create a ``testSerializer``
|
26 |
+
method on your treebuilder which accepts a node and returns a string
|
27 |
+
containing Node and its children serialized according to the format used in
|
28 |
+
the unittests
|
29 |
+
|
30 |
+
"""
|
31 |
+
|
32 |
+
from __future__ import absolute_import, division, unicode_literals
|
33 |
+
|
34 |
+
from .._utils import default_etree
|
35 |
+
|
36 |
+
treeBuilderCache = {}
|
37 |
+
|
38 |
+
|
39 |
+
def getTreeBuilder(treeType, implementation=None, **kwargs):
|
40 |
+
"""Get a TreeBuilder class for various types of trees with built-in support
|
41 |
+
|
42 |
+
:arg treeType: the name of the tree type required (case-insensitive). Supported
|
43 |
+
values are:
|
44 |
+
|
45 |
+
* "dom" - A generic builder for DOM implementations, defaulting to a
|
46 |
+
xml.dom.minidom based implementation.
|
47 |
+
* "etree" - A generic builder for tree implementations exposing an
|
48 |
+
ElementTree-like interface, defaulting to xml.etree.cElementTree if
|
49 |
+
available and xml.etree.ElementTree if not.
|
50 |
+
* "lxml" - A etree-based builder for lxml.etree, handling limitations
|
51 |
+
of lxml's implementation.
|
52 |
+
|
53 |
+
:arg implementation: (Currently applies to the "etree" and "dom" tree
|
54 |
+
types). A module implementing the tree type e.g. xml.etree.ElementTree
|
55 |
+
or xml.etree.cElementTree.
|
56 |
+
|
57 |
+
:arg kwargs: Any additional options to pass to the TreeBuilder when
|
58 |
+
creating it.
|
59 |
+
|
60 |
+
Example:
|
61 |
+
|
62 |
+
>>> from html5lib.treebuilders import getTreeBuilder
|
63 |
+
>>> builder = getTreeBuilder('etree')
|
64 |
+
|
65 |
+
"""
|
66 |
+
|
67 |
+
treeType = treeType.lower()
|
68 |
+
if treeType not in treeBuilderCache:
|
69 |
+
if treeType == "dom":
|
70 |
+
from . import dom
|
71 |
+
# Come up with a sane default (pref. from the stdlib)
|
72 |
+
if implementation is None:
|
73 |
+
from xml.dom import minidom
|
74 |
+
implementation = minidom
|
75 |
+
# NEVER cache here, caching is done in the dom submodule
|
76 |
+
return dom.getDomModule(implementation, **kwargs).TreeBuilder
|
77 |
+
elif treeType == "lxml":
|
78 |
+
from . import etree_lxml
|
79 |
+
treeBuilderCache[treeType] = etree_lxml.TreeBuilder
|
80 |
+
elif treeType == "etree":
|
81 |
+
from . import etree
|
82 |
+
if implementation is None:
|
83 |
+
implementation = default_etree
|
84 |
+
# NEVER cache here, caching is done in the etree submodule
|
85 |
+
return etree.getETreeModule(implementation, **kwargs).TreeBuilder
|
86 |
+
else:
|
87 |
+
raise ValueError("""Unrecognised treebuilder "%s" """ % treeType)
|
88 |
+
return treeBuilderCache.get(treeType)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (3.33 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-310.pyc
ADDED
Binary file (11.3 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-310.pyc
ADDED
Binary file (11.7 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-310.pyc
ADDED
Binary file (13 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/base.py
ADDED
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
from pip._vendor.six import text_type
|
3 |
+
|
4 |
+
from ..constants import scopingElements, tableInsertModeElements, namespaces
|
5 |
+
|
6 |
+
# The scope markers are inserted when entering object elements,
|
7 |
+
# marquees, table cells, and table captions, and are used to prevent formatting
|
8 |
+
# from "leaking" into tables, object elements, and marquees.
|
9 |
+
Marker = None
|
10 |
+
|
11 |
+
listElementsMap = {
|
12 |
+
None: (frozenset(scopingElements), False),
|
13 |
+
"button": (frozenset(scopingElements | {(namespaces["html"], "button")}), False),
|
14 |
+
"list": (frozenset(scopingElements | {(namespaces["html"], "ol"),
|
15 |
+
(namespaces["html"], "ul")}), False),
|
16 |
+
"table": (frozenset([(namespaces["html"], "html"),
|
17 |
+
(namespaces["html"], "table")]), False),
|
18 |
+
"select": (frozenset([(namespaces["html"], "optgroup"),
|
19 |
+
(namespaces["html"], "option")]), True)
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
class Node(object):
|
24 |
+
"""Represents an item in the tree"""
|
25 |
+
def __init__(self, name):
|
26 |
+
"""Creates a Node
|
27 |
+
|
28 |
+
:arg name: The tag name associated with the node
|
29 |
+
|
30 |
+
"""
|
31 |
+
# The tag name associated with the node
|
32 |
+
self.name = name
|
33 |
+
# The parent of the current node (or None for the document node)
|
34 |
+
self.parent = None
|
35 |
+
# The value of the current node (applies to text nodes and comments)
|
36 |
+
self.value = None
|
37 |
+
# A dict holding name -> value pairs for attributes of the node
|
38 |
+
self.attributes = {}
|
39 |
+
# A list of child nodes of the current node. This must include all
|
40 |
+
# elements but not necessarily other node types.
|
41 |
+
self.childNodes = []
|
42 |
+
# A list of miscellaneous flags that can be set on the node.
|
43 |
+
self._flags = []
|
44 |
+
|
45 |
+
def __str__(self):
|
46 |
+
attributesStr = " ".join(["%s=\"%s\"" % (name, value)
|
47 |
+
for name, value in
|
48 |
+
self.attributes.items()])
|
49 |
+
if attributesStr:
|
50 |
+
return "<%s %s>" % (self.name, attributesStr)
|
51 |
+
else:
|
52 |
+
return "<%s>" % (self.name)
|
53 |
+
|
54 |
+
def __repr__(self):
|
55 |
+
return "<%s>" % (self.name)
|
56 |
+
|
57 |
+
def appendChild(self, node):
|
58 |
+
"""Insert node as a child of the current node
|
59 |
+
|
60 |
+
:arg node: the node to insert
|
61 |
+
|
62 |
+
"""
|
63 |
+
raise NotImplementedError
|
64 |
+
|
65 |
+
def insertText(self, data, insertBefore=None):
|
66 |
+
"""Insert data as text in the current node, positioned before the
|
67 |
+
start of node insertBefore or to the end of the node's text.
|
68 |
+
|
69 |
+
:arg data: the data to insert
|
70 |
+
|
71 |
+
:arg insertBefore: True if you want to insert the text before the node
|
72 |
+
and False if you want to insert it after the node
|
73 |
+
|
74 |
+
"""
|
75 |
+
raise NotImplementedError
|
76 |
+
|
77 |
+
def insertBefore(self, node, refNode):
|
78 |
+
"""Insert node as a child of the current node, before refNode in the
|
79 |
+
list of child nodes. Raises ValueError if refNode is not a child of
|
80 |
+
the current node
|
81 |
+
|
82 |
+
:arg node: the node to insert
|
83 |
+
|
84 |
+
:arg refNode: the child node to insert the node before
|
85 |
+
|
86 |
+
"""
|
87 |
+
raise NotImplementedError
|
88 |
+
|
89 |
+
def removeChild(self, node):
|
90 |
+
"""Remove node from the children of the current node
|
91 |
+
|
92 |
+
:arg node: the child node to remove
|
93 |
+
|
94 |
+
"""
|
95 |
+
raise NotImplementedError
|
96 |
+
|
97 |
+
def reparentChildren(self, newParent):
|
98 |
+
"""Move all the children of the current node to newParent.
|
99 |
+
This is needed so that trees that don't store text as nodes move the
|
100 |
+
text in the correct way
|
101 |
+
|
102 |
+
:arg newParent: the node to move all this node's children to
|
103 |
+
|
104 |
+
"""
|
105 |
+
# XXX - should this method be made more general?
|
106 |
+
for child in self.childNodes:
|
107 |
+
newParent.appendChild(child)
|
108 |
+
self.childNodes = []
|
109 |
+
|
110 |
+
def cloneNode(self):
|
111 |
+
"""Return a shallow copy of the current node i.e. a node with the same
|
112 |
+
name and attributes but with no parent or child nodes
|
113 |
+
"""
|
114 |
+
raise NotImplementedError
|
115 |
+
|
116 |
+
def hasContent(self):
|
117 |
+
"""Return true if the node has children or text, false otherwise
|
118 |
+
"""
|
119 |
+
raise NotImplementedError
|
120 |
+
|
121 |
+
|
122 |
+
class ActiveFormattingElements(list):
|
123 |
+
def append(self, node):
|
124 |
+
equalCount = 0
|
125 |
+
if node != Marker:
|
126 |
+
for element in self[::-1]:
|
127 |
+
if element == Marker:
|
128 |
+
break
|
129 |
+
if self.nodesEqual(element, node):
|
130 |
+
equalCount += 1
|
131 |
+
if equalCount == 3:
|
132 |
+
self.remove(element)
|
133 |
+
break
|
134 |
+
list.append(self, node)
|
135 |
+
|
136 |
+
def nodesEqual(self, node1, node2):
|
137 |
+
if not node1.nameTuple == node2.nameTuple:
|
138 |
+
return False
|
139 |
+
|
140 |
+
if not node1.attributes == node2.attributes:
|
141 |
+
return False
|
142 |
+
|
143 |
+
return True
|
144 |
+
|
145 |
+
|
146 |
+
class TreeBuilder(object):
|
147 |
+
"""Base treebuilder implementation
|
148 |
+
|
149 |
+
* documentClass - the class to use for the bottommost node of a document
|
150 |
+
* elementClass - the class to use for HTML Elements
|
151 |
+
* commentClass - the class to use for comments
|
152 |
+
* doctypeClass - the class to use for doctypes
|
153 |
+
|
154 |
+
"""
|
155 |
+
# pylint:disable=not-callable
|
156 |
+
|
157 |
+
# Document class
|
158 |
+
documentClass = None
|
159 |
+
|
160 |
+
# The class to use for creating a node
|
161 |
+
elementClass = None
|
162 |
+
|
163 |
+
# The class to use for creating comments
|
164 |
+
commentClass = None
|
165 |
+
|
166 |
+
# The class to use for creating doctypes
|
167 |
+
doctypeClass = None
|
168 |
+
|
169 |
+
# Fragment class
|
170 |
+
fragmentClass = None
|
171 |
+
|
172 |
+
def __init__(self, namespaceHTMLElements):
|
173 |
+
"""Create a TreeBuilder
|
174 |
+
|
175 |
+
:arg namespaceHTMLElements: whether or not to namespace HTML elements
|
176 |
+
|
177 |
+
"""
|
178 |
+
if namespaceHTMLElements:
|
179 |
+
self.defaultNamespace = "http://www.w3.org/1999/xhtml"
|
180 |
+
else:
|
181 |
+
self.defaultNamespace = None
|
182 |
+
self.reset()
|
183 |
+
|
184 |
+
def reset(self):
|
185 |
+
self.openElements = []
|
186 |
+
self.activeFormattingElements = ActiveFormattingElements()
|
187 |
+
|
188 |
+
# XXX - rename these to headElement, formElement
|
189 |
+
self.headPointer = None
|
190 |
+
self.formPointer = None
|
191 |
+
|
192 |
+
self.insertFromTable = False
|
193 |
+
|
194 |
+
self.document = self.documentClass()
|
195 |
+
|
196 |
+
def elementInScope(self, target, variant=None):
|
197 |
+
|
198 |
+
# If we pass a node in we match that. if we pass a string
|
199 |
+
# match any node with that name
|
200 |
+
exactNode = hasattr(target, "nameTuple")
|
201 |
+
if not exactNode:
|
202 |
+
if isinstance(target, text_type):
|
203 |
+
target = (namespaces["html"], target)
|
204 |
+
assert isinstance(target, tuple)
|
205 |
+
|
206 |
+
listElements, invert = listElementsMap[variant]
|
207 |
+
|
208 |
+
for node in reversed(self.openElements):
|
209 |
+
if exactNode and node == target:
|
210 |
+
return True
|
211 |
+
elif not exactNode and node.nameTuple == target:
|
212 |
+
return True
|
213 |
+
elif (invert ^ (node.nameTuple in listElements)):
|
214 |
+
return False
|
215 |
+
|
216 |
+
assert False # We should never reach this point
|
217 |
+
|
218 |
+
def reconstructActiveFormattingElements(self):
|
219 |
+
# Within this algorithm the order of steps described in the
|
220 |
+
# specification is not quite the same as the order of steps in the
|
221 |
+
# code. It should still do the same though.
|
222 |
+
|
223 |
+
# Step 1: stop the algorithm when there's nothing to do.
|
224 |
+
if not self.activeFormattingElements:
|
225 |
+
return
|
226 |
+
|
227 |
+
# Step 2 and step 3: we start with the last element. So i is -1.
|
228 |
+
i = len(self.activeFormattingElements) - 1
|
229 |
+
entry = self.activeFormattingElements[i]
|
230 |
+
if entry == Marker or entry in self.openElements:
|
231 |
+
return
|
232 |
+
|
233 |
+
# Step 6
|
234 |
+
while entry != Marker and entry not in self.openElements:
|
235 |
+
if i == 0:
|
236 |
+
# This will be reset to 0 below
|
237 |
+
i = -1
|
238 |
+
break
|
239 |
+
i -= 1
|
240 |
+
# Step 5: let entry be one earlier in the list.
|
241 |
+
entry = self.activeFormattingElements[i]
|
242 |
+
|
243 |
+
while True:
|
244 |
+
# Step 7
|
245 |
+
i += 1
|
246 |
+
|
247 |
+
# Step 8
|
248 |
+
entry = self.activeFormattingElements[i]
|
249 |
+
clone = entry.cloneNode() # Mainly to get a new copy of the attributes
|
250 |
+
|
251 |
+
# Step 9
|
252 |
+
element = self.insertElement({"type": "StartTag",
|
253 |
+
"name": clone.name,
|
254 |
+
"namespace": clone.namespace,
|
255 |
+
"data": clone.attributes})
|
256 |
+
|
257 |
+
# Step 10
|
258 |
+
self.activeFormattingElements[i] = element
|
259 |
+
|
260 |
+
# Step 11
|
261 |
+
if element == self.activeFormattingElements[-1]:
|
262 |
+
break
|
263 |
+
|
264 |
+
def clearActiveFormattingElements(self):
|
265 |
+
entry = self.activeFormattingElements.pop()
|
266 |
+
while self.activeFormattingElements and entry != Marker:
|
267 |
+
entry = self.activeFormattingElements.pop()
|
268 |
+
|
269 |
+
def elementInActiveFormattingElements(self, name):
|
270 |
+
"""Check if an element exists between the end of the active
|
271 |
+
formatting elements and the last marker. If it does, return it, else
|
272 |
+
return false"""
|
273 |
+
|
274 |
+
for item in self.activeFormattingElements[::-1]:
|
275 |
+
# Check for Marker first because if it's a Marker it doesn't have a
|
276 |
+
# name attribute.
|
277 |
+
if item == Marker:
|
278 |
+
break
|
279 |
+
elif item.name == name:
|
280 |
+
return item
|
281 |
+
return False
|
282 |
+
|
283 |
+
def insertRoot(self, token):
|
284 |
+
element = self.createElement(token)
|
285 |
+
self.openElements.append(element)
|
286 |
+
self.document.appendChild(element)
|
287 |
+
|
288 |
+
def insertDoctype(self, token):
|
289 |
+
name = token["name"]
|
290 |
+
publicId = token["publicId"]
|
291 |
+
systemId = token["systemId"]
|
292 |
+
|
293 |
+
doctype = self.doctypeClass(name, publicId, systemId)
|
294 |
+
self.document.appendChild(doctype)
|
295 |
+
|
296 |
+
def insertComment(self, token, parent=None):
|
297 |
+
if parent is None:
|
298 |
+
parent = self.openElements[-1]
|
299 |
+
parent.appendChild(self.commentClass(token["data"]))
|
300 |
+
|
301 |
+
def createElement(self, token):
|
302 |
+
"""Create an element but don't insert it anywhere"""
|
303 |
+
name = token["name"]
|
304 |
+
namespace = token.get("namespace", self.defaultNamespace)
|
305 |
+
element = self.elementClass(name, namespace)
|
306 |
+
element.attributes = token["data"]
|
307 |
+
return element
|
308 |
+
|
309 |
+
def _getInsertFromTable(self):
|
310 |
+
return self._insertFromTable
|
311 |
+
|
312 |
+
def _setInsertFromTable(self, value):
|
313 |
+
"""Switch the function used to insert an element from the
|
314 |
+
normal one to the misnested table one and back again"""
|
315 |
+
self._insertFromTable = value
|
316 |
+
if value:
|
317 |
+
self.insertElement = self.insertElementTable
|
318 |
+
else:
|
319 |
+
self.insertElement = self.insertElementNormal
|
320 |
+
|
321 |
+
insertFromTable = property(_getInsertFromTable, _setInsertFromTable)
|
322 |
+
|
323 |
+
def insertElementNormal(self, token):
|
324 |
+
name = token["name"]
|
325 |
+
assert isinstance(name, text_type), "Element %s not unicode" % name
|
326 |
+
namespace = token.get("namespace", self.defaultNamespace)
|
327 |
+
element = self.elementClass(name, namespace)
|
328 |
+
element.attributes = token["data"]
|
329 |
+
self.openElements[-1].appendChild(element)
|
330 |
+
self.openElements.append(element)
|
331 |
+
return element
|
332 |
+
|
333 |
+
def insertElementTable(self, token):
|
334 |
+
"""Create an element and insert it into the tree"""
|
335 |
+
element = self.createElement(token)
|
336 |
+
if self.openElements[-1].name not in tableInsertModeElements:
|
337 |
+
return self.insertElementNormal(token)
|
338 |
+
else:
|
339 |
+
# We should be in the InTable mode. This means we want to do
|
340 |
+
# special magic element rearranging
|
341 |
+
parent, insertBefore = self.getTableMisnestedNodePosition()
|
342 |
+
if insertBefore is None:
|
343 |
+
parent.appendChild(element)
|
344 |
+
else:
|
345 |
+
parent.insertBefore(element, insertBefore)
|
346 |
+
self.openElements.append(element)
|
347 |
+
return element
|
348 |
+
|
349 |
+
def insertText(self, data, parent=None):
|
350 |
+
"""Insert text data."""
|
351 |
+
if parent is None:
|
352 |
+
parent = self.openElements[-1]
|
353 |
+
|
354 |
+
if (not self.insertFromTable or (self.insertFromTable and
|
355 |
+
self.openElements[-1].name
|
356 |
+
not in tableInsertModeElements)):
|
357 |
+
parent.insertText(data)
|
358 |
+
else:
|
359 |
+
# We should be in the InTable mode. This means we want to do
|
360 |
+
# special magic element rearranging
|
361 |
+
parent, insertBefore = self.getTableMisnestedNodePosition()
|
362 |
+
parent.insertText(data, insertBefore)
|
363 |
+
|
364 |
+
def getTableMisnestedNodePosition(self):
|
365 |
+
"""Get the foster parent element, and sibling to insert before
|
366 |
+
(or None) when inserting a misnested table node"""
|
367 |
+
# The foster parent element is the one which comes before the most
|
368 |
+
# recently opened table element
|
369 |
+
# XXX - this is really inelegant
|
370 |
+
lastTable = None
|
371 |
+
fosterParent = None
|
372 |
+
insertBefore = None
|
373 |
+
for elm in self.openElements[::-1]:
|
374 |
+
if elm.name == "table":
|
375 |
+
lastTable = elm
|
376 |
+
break
|
377 |
+
if lastTable:
|
378 |
+
# XXX - we should really check that this parent is actually a
|
379 |
+
# node here
|
380 |
+
if lastTable.parent:
|
381 |
+
fosterParent = lastTable.parent
|
382 |
+
insertBefore = lastTable
|
383 |
+
else:
|
384 |
+
fosterParent = self.openElements[
|
385 |
+
self.openElements.index(lastTable) - 1]
|
386 |
+
else:
|
387 |
+
fosterParent = self.openElements[0]
|
388 |
+
return fosterParent, insertBefore
|
389 |
+
|
390 |
+
def generateImpliedEndTags(self, exclude=None):
|
391 |
+
name = self.openElements[-1].name
|
392 |
+
# XXX td, th and tr are not actually needed
|
393 |
+
if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt")) and
|
394 |
+
name != exclude):
|
395 |
+
self.openElements.pop()
|
396 |
+
# XXX This is not entirely what the specification says. We should
|
397 |
+
# investigate it more closely.
|
398 |
+
self.generateImpliedEndTags(exclude)
|
399 |
+
|
400 |
+
def getDocument(self):
|
401 |
+
"""Return the final tree"""
|
402 |
+
return self.document
|
403 |
+
|
404 |
+
def getFragment(self):
|
405 |
+
"""Return the final fragment"""
|
406 |
+
# assert self.innerHTML
|
407 |
+
fragment = self.fragmentClass()
|
408 |
+
self.openElements[0].reparentChildren(fragment)
|
409 |
+
return fragment
|
410 |
+
|
411 |
+
def testSerializer(self, node):
|
412 |
+
"""Serialize the subtree of node in the format required by unit tests
|
413 |
+
|
414 |
+
:arg node: the node from which to start serializing
|
415 |
+
|
416 |
+
"""
|
417 |
+
raise NotImplementedError
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
ADDED
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
|
3 |
+
|
4 |
+
try:
|
5 |
+
from collections.abc import MutableMapping
|
6 |
+
except ImportError: # Python 2.7
|
7 |
+
from collections import MutableMapping
|
8 |
+
from xml.dom import minidom, Node
|
9 |
+
import weakref
|
10 |
+
|
11 |
+
from . import base
|
12 |
+
from .. import constants
|
13 |
+
from ..constants import namespaces
|
14 |
+
from .._utils import moduleFactoryFactory
|
15 |
+
|
16 |
+
|
17 |
+
def getDomBuilder(DomImplementation):
|
18 |
+
Dom = DomImplementation
|
19 |
+
|
20 |
+
class AttrList(MutableMapping):
|
21 |
+
def __init__(self, element):
|
22 |
+
self.element = element
|
23 |
+
|
24 |
+
def __iter__(self):
|
25 |
+
return iter(self.element.attributes.keys())
|
26 |
+
|
27 |
+
def __setitem__(self, name, value):
|
28 |
+
if isinstance(name, tuple):
|
29 |
+
raise NotImplementedError
|
30 |
+
else:
|
31 |
+
attr = self.element.ownerDocument.createAttribute(name)
|
32 |
+
attr.value = value
|
33 |
+
self.element.attributes[name] = attr
|
34 |
+
|
35 |
+
def __len__(self):
|
36 |
+
return len(self.element.attributes)
|
37 |
+
|
38 |
+
def items(self):
|
39 |
+
return list(self.element.attributes.items())
|
40 |
+
|
41 |
+
def values(self):
|
42 |
+
return list(self.element.attributes.values())
|
43 |
+
|
44 |
+
def __getitem__(self, name):
|
45 |
+
if isinstance(name, tuple):
|
46 |
+
raise NotImplementedError
|
47 |
+
else:
|
48 |
+
return self.element.attributes[name].value
|
49 |
+
|
50 |
+
def __delitem__(self, name):
|
51 |
+
if isinstance(name, tuple):
|
52 |
+
raise NotImplementedError
|
53 |
+
else:
|
54 |
+
del self.element.attributes[name]
|
55 |
+
|
56 |
+
class NodeBuilder(base.Node):
|
57 |
+
def __init__(self, element):
|
58 |
+
base.Node.__init__(self, element.nodeName)
|
59 |
+
self.element = element
|
60 |
+
|
61 |
+
namespace = property(lambda self: hasattr(self.element, "namespaceURI") and
|
62 |
+
self.element.namespaceURI or None)
|
63 |
+
|
64 |
+
def appendChild(self, node):
|
65 |
+
node.parent = self
|
66 |
+
self.element.appendChild(node.element)
|
67 |
+
|
68 |
+
def insertText(self, data, insertBefore=None):
|
69 |
+
text = self.element.ownerDocument.createTextNode(data)
|
70 |
+
if insertBefore:
|
71 |
+
self.element.insertBefore(text, insertBefore.element)
|
72 |
+
else:
|
73 |
+
self.element.appendChild(text)
|
74 |
+
|
75 |
+
def insertBefore(self, node, refNode):
|
76 |
+
self.element.insertBefore(node.element, refNode.element)
|
77 |
+
node.parent = self
|
78 |
+
|
79 |
+
def removeChild(self, node):
|
80 |
+
if node.element.parentNode == self.element:
|
81 |
+
self.element.removeChild(node.element)
|
82 |
+
node.parent = None
|
83 |
+
|
84 |
+
def reparentChildren(self, newParent):
|
85 |
+
while self.element.hasChildNodes():
|
86 |
+
child = self.element.firstChild
|
87 |
+
self.element.removeChild(child)
|
88 |
+
newParent.element.appendChild(child)
|
89 |
+
self.childNodes = []
|
90 |
+
|
91 |
+
def getAttributes(self):
|
92 |
+
return AttrList(self.element)
|
93 |
+
|
94 |
+
def setAttributes(self, attributes):
|
95 |
+
if attributes:
|
96 |
+
for name, value in list(attributes.items()):
|
97 |
+
if isinstance(name, tuple):
|
98 |
+
if name[0] is not None:
|
99 |
+
qualifiedName = (name[0] + ":" + name[1])
|
100 |
+
else:
|
101 |
+
qualifiedName = name[1]
|
102 |
+
self.element.setAttributeNS(name[2], qualifiedName,
|
103 |
+
value)
|
104 |
+
else:
|
105 |
+
self.element.setAttribute(
|
106 |
+
name, value)
|
107 |
+
attributes = property(getAttributes, setAttributes)
|
108 |
+
|
109 |
+
def cloneNode(self):
|
110 |
+
return NodeBuilder(self.element.cloneNode(False))
|
111 |
+
|
112 |
+
def hasContent(self):
|
113 |
+
return self.element.hasChildNodes()
|
114 |
+
|
115 |
+
def getNameTuple(self):
|
116 |
+
if self.namespace is None:
|
117 |
+
return namespaces["html"], self.name
|
118 |
+
else:
|
119 |
+
return self.namespace, self.name
|
120 |
+
|
121 |
+
nameTuple = property(getNameTuple)
|
122 |
+
|
123 |
+
class TreeBuilder(base.TreeBuilder): # pylint:disable=unused-variable
|
124 |
+
def documentClass(self):
|
125 |
+
self.dom = Dom.getDOMImplementation().createDocument(None, None, None)
|
126 |
+
return weakref.proxy(self)
|
127 |
+
|
128 |
+
def insertDoctype(self, token):
|
129 |
+
name = token["name"]
|
130 |
+
publicId = token["publicId"]
|
131 |
+
systemId = token["systemId"]
|
132 |
+
|
133 |
+
domimpl = Dom.getDOMImplementation()
|
134 |
+
doctype = domimpl.createDocumentType(name, publicId, systemId)
|
135 |
+
self.document.appendChild(NodeBuilder(doctype))
|
136 |
+
if Dom == minidom:
|
137 |
+
doctype.ownerDocument = self.dom
|
138 |
+
|
139 |
+
def elementClass(self, name, namespace=None):
|
140 |
+
if namespace is None and self.defaultNamespace is None:
|
141 |
+
node = self.dom.createElement(name)
|
142 |
+
else:
|
143 |
+
node = self.dom.createElementNS(namespace, name)
|
144 |
+
|
145 |
+
return NodeBuilder(node)
|
146 |
+
|
147 |
+
def commentClass(self, data):
|
148 |
+
return NodeBuilder(self.dom.createComment(data))
|
149 |
+
|
150 |
+
def fragmentClass(self):
|
151 |
+
return NodeBuilder(self.dom.createDocumentFragment())
|
152 |
+
|
153 |
+
def appendChild(self, node):
|
154 |
+
self.dom.appendChild(node.element)
|
155 |
+
|
156 |
+
def testSerializer(self, element):
|
157 |
+
return testSerializer(element)
|
158 |
+
|
159 |
+
def getDocument(self):
|
160 |
+
return self.dom
|
161 |
+
|
162 |
+
def getFragment(self):
|
163 |
+
return base.TreeBuilder.getFragment(self).element
|
164 |
+
|
165 |
+
def insertText(self, data, parent=None):
|
166 |
+
data = data
|
167 |
+
if parent != self:
|
168 |
+
base.TreeBuilder.insertText(self, data, parent)
|
169 |
+
else:
|
170 |
+
# HACK: allow text nodes as children of the document node
|
171 |
+
if hasattr(self.dom, '_child_node_types'):
|
172 |
+
# pylint:disable=protected-access
|
173 |
+
if Node.TEXT_NODE not in self.dom._child_node_types:
|
174 |
+
self.dom._child_node_types = list(self.dom._child_node_types)
|
175 |
+
self.dom._child_node_types.append(Node.TEXT_NODE)
|
176 |
+
self.dom.appendChild(self.dom.createTextNode(data))
|
177 |
+
|
178 |
+
implementation = DomImplementation
|
179 |
+
name = None
|
180 |
+
|
181 |
+
def testSerializer(element):
|
182 |
+
element.normalize()
|
183 |
+
rv = []
|
184 |
+
|
185 |
+
def serializeElement(element, indent=0):
|
186 |
+
if element.nodeType == Node.DOCUMENT_TYPE_NODE:
|
187 |
+
if element.name:
|
188 |
+
if element.publicId or element.systemId:
|
189 |
+
publicId = element.publicId or ""
|
190 |
+
systemId = element.systemId or ""
|
191 |
+
rv.append("""|%s<!DOCTYPE %s "%s" "%s">""" %
|
192 |
+
(' ' * indent, element.name, publicId, systemId))
|
193 |
+
else:
|
194 |
+
rv.append("|%s<!DOCTYPE %s>" % (' ' * indent, element.name))
|
195 |
+
else:
|
196 |
+
rv.append("|%s<!DOCTYPE >" % (' ' * indent,))
|
197 |
+
elif element.nodeType == Node.DOCUMENT_NODE:
|
198 |
+
rv.append("#document")
|
199 |
+
elif element.nodeType == Node.DOCUMENT_FRAGMENT_NODE:
|
200 |
+
rv.append("#document-fragment")
|
201 |
+
elif element.nodeType == Node.COMMENT_NODE:
|
202 |
+
rv.append("|%s<!-- %s -->" % (' ' * indent, element.nodeValue))
|
203 |
+
elif element.nodeType == Node.TEXT_NODE:
|
204 |
+
rv.append("|%s\"%s\"" % (' ' * indent, element.nodeValue))
|
205 |
+
else:
|
206 |
+
if (hasattr(element, "namespaceURI") and
|
207 |
+
element.namespaceURI is not None):
|
208 |
+
name = "%s %s" % (constants.prefixes[element.namespaceURI],
|
209 |
+
element.nodeName)
|
210 |
+
else:
|
211 |
+
name = element.nodeName
|
212 |
+
rv.append("|%s<%s>" % (' ' * indent, name))
|
213 |
+
if element.hasAttributes():
|
214 |
+
attributes = []
|
215 |
+
for i in range(len(element.attributes)):
|
216 |
+
attr = element.attributes.item(i)
|
217 |
+
name = attr.nodeName
|
218 |
+
value = attr.value
|
219 |
+
ns = attr.namespaceURI
|
220 |
+
if ns:
|
221 |
+
name = "%s %s" % (constants.prefixes[ns], attr.localName)
|
222 |
+
else:
|
223 |
+
name = attr.nodeName
|
224 |
+
attributes.append((name, value))
|
225 |
+
|
226 |
+
for name, value in sorted(attributes):
|
227 |
+
rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
|
228 |
+
indent += 2
|
229 |
+
for child in element.childNodes:
|
230 |
+
serializeElement(child, indent)
|
231 |
+
serializeElement(element, 0)
|
232 |
+
|
233 |
+
return "\n".join(rv)
|
234 |
+
|
235 |
+
return locals()
|
236 |
+
|
237 |
+
|
238 |
+
# The actual means to get a module!
|
239 |
+
getDomModule = moduleFactoryFactory(getDomBuilder)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree.py
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, unicode_literals
|
2 |
+
# pylint:disable=protected-access
|
3 |
+
|
4 |
+
from pip._vendor.six import text_type
|
5 |
+
|
6 |
+
import re
|
7 |
+
|
8 |
+
from copy import copy
|
9 |
+
|
10 |
+
from . import base
|
11 |
+
from .. import _ihatexml
|
12 |
+
from .. import constants
|
13 |
+
from ..constants import namespaces
|
14 |
+
from .._utils import moduleFactoryFactory
|
15 |
+
|
16 |
+
tag_regexp = re.compile("{([^}]*)}(.*)")
|
17 |
+
|
18 |
+
|
19 |
+
def getETreeBuilder(ElementTreeImplementation, fullTree=False):
|
20 |
+
ElementTree = ElementTreeImplementation
|
21 |
+
ElementTreeCommentType = ElementTree.Comment("asd").tag
|
22 |
+
|
23 |
+
class Element(base.Node):
|
24 |
+
def __init__(self, name, namespace=None):
|
25 |
+
self._name = name
|
26 |
+
self._namespace = namespace
|
27 |
+
self._element = ElementTree.Element(self._getETreeTag(name,
|
28 |
+
namespace))
|
29 |
+
if namespace is None:
|
30 |
+
self.nameTuple = namespaces["html"], self._name
|
31 |
+
else:
|
32 |
+
self.nameTuple = self._namespace, self._name
|
33 |
+
self.parent = None
|
34 |
+
self._childNodes = []
|
35 |
+
self._flags = []
|
36 |
+
|
37 |
+
def _getETreeTag(self, name, namespace):
|
38 |
+
if namespace is None:
|
39 |
+
etree_tag = name
|
40 |
+
else:
|
41 |
+
etree_tag = "{%s}%s" % (namespace, name)
|
42 |
+
return etree_tag
|
43 |
+
|
44 |
+
def _setName(self, name):
|
45 |
+
self._name = name
|
46 |
+
self._element.tag = self._getETreeTag(self._name, self._namespace)
|
47 |
+
|
48 |
+
def _getName(self):
|
49 |
+
return self._name
|
50 |
+
|
51 |
+
name = property(_getName, _setName)
|
52 |
+
|
53 |
+
def _setNamespace(self, namespace):
|
54 |
+
self._namespace = namespace
|
55 |
+
self._element.tag = self._getETreeTag(self._name, self._namespace)
|
56 |
+
|
57 |
+
def _getNamespace(self):
|
58 |
+
return self._namespace
|
59 |
+
|
60 |
+
namespace = property(_getNamespace, _setNamespace)
|
61 |
+
|
62 |
+
def _getAttributes(self):
|
63 |
+
return self._element.attrib
|
64 |
+
|
65 |
+
def _setAttributes(self, attributes):
|
66 |
+
el_attrib = self._element.attrib
|
67 |
+
el_attrib.clear()
|
68 |
+
if attributes:
|
69 |
+
# calling .items _always_ allocates, and the above truthy check is cheaper than the
|
70 |
+
# allocation on average
|
71 |
+
for key, value in attributes.items():
|
72 |
+
if isinstance(key, tuple):
|
73 |
+
name = "{%s}%s" % (key[2], key[1])
|
74 |
+
else:
|
75 |
+
name = key
|
76 |
+
el_attrib[name] = value
|
77 |
+
|
78 |
+
attributes = property(_getAttributes, _setAttributes)
|
79 |
+
|
80 |
+
def _getChildNodes(self):
|
81 |
+
return self._childNodes
|
82 |
+
|
83 |
+
def _setChildNodes(self, value):
|
84 |
+
del self._element[:]
|
85 |
+
self._childNodes = []
|
86 |
+
for element in value:
|
87 |
+
self.insertChild(element)
|
88 |
+
|
89 |
+
childNodes = property(_getChildNodes, _setChildNodes)
|
90 |
+
|
91 |
+
def hasContent(self):
|
92 |
+
"""Return true if the node has children or text"""
|
93 |
+
return bool(self._element.text or len(self._element))
|
94 |
+
|
95 |
+
def appendChild(self, node):
|
96 |
+
self._childNodes.append(node)
|
97 |
+
self._element.append(node._element)
|
98 |
+
node.parent = self
|
99 |
+
|
100 |
+
def insertBefore(self, node, refNode):
|
101 |
+
index = list(self._element).index(refNode._element)
|
102 |
+
self._element.insert(index, node._element)
|
103 |
+
node.parent = self
|
104 |
+
|
105 |
+
def removeChild(self, node):
|
106 |
+
self._childNodes.remove(node)
|
107 |
+
self._element.remove(node._element)
|
108 |
+
node.parent = None
|
109 |
+
|
110 |
+
def insertText(self, data, insertBefore=None):
|
111 |
+
if not(len(self._element)):
|
112 |
+
if not self._element.text:
|
113 |
+
self._element.text = ""
|
114 |
+
self._element.text += data
|
115 |
+
elif insertBefore is None:
|
116 |
+
# Insert the text as the tail of the last child element
|
117 |
+
if not self._element[-1].tail:
|
118 |
+
self._element[-1].tail = ""
|
119 |
+
self._element[-1].tail += data
|
120 |
+
else:
|
121 |
+
# Insert the text before the specified node
|
122 |
+
children = list(self._element)
|
123 |
+
index = children.index(insertBefore._element)
|
124 |
+
if index > 0:
|
125 |
+
if not self._element[index - 1].tail:
|
126 |
+
self._element[index - 1].tail = ""
|
127 |
+
self._element[index - 1].tail += data
|
128 |
+
else:
|
129 |
+
if not self._element.text:
|
130 |
+
self._element.text = ""
|
131 |
+
self._element.text += data
|
132 |
+
|
133 |
+
def cloneNode(self):
|
134 |
+
element = type(self)(self.name, self.namespace)
|
135 |
+
if self._element.attrib:
|
136 |
+
element._element.attrib = copy(self._element.attrib)
|
137 |
+
return element
|
138 |
+
|
139 |
+
def reparentChildren(self, newParent):
|
140 |
+
if newParent.childNodes:
|
141 |
+
newParent.childNodes[-1]._element.tail += self._element.text
|
142 |
+
else:
|
143 |
+
if not newParent._element.text:
|
144 |
+
newParent._element.text = ""
|
145 |
+
if self._element.text is not None:
|
146 |
+
newParent._element.text += self._element.text
|
147 |
+
self._element.text = ""
|
148 |
+
base.Node.reparentChildren(self, newParent)
|
149 |
+
|
150 |
+
class Comment(Element):
|
151 |
+
def __init__(self, data):
|
152 |
+
# Use the superclass constructor to set all properties on the
|
153 |
+
# wrapper element
|
154 |
+
self._element = ElementTree.Comment(data)
|
155 |
+
self.parent = None
|
156 |
+
self._childNodes = []
|
157 |
+
self._flags = []
|
158 |
+
|
159 |
+
def _getData(self):
|
160 |
+
return self._element.text
|
161 |
+
|
162 |
+
def _setData(self, value):
|
163 |
+
self._element.text = value
|
164 |
+
|
165 |
+
data = property(_getData, _setData)
|
166 |
+
|
167 |
+
class DocumentType(Element):
|
168 |
+
def __init__(self, name, publicId, systemId):
|
169 |
+
Element.__init__(self, "<!DOCTYPE>")
|
170 |
+
self._element.text = name
|
171 |
+
self.publicId = publicId
|
172 |
+
self.systemId = systemId
|
173 |
+
|
174 |
+
def _getPublicId(self):
|
175 |
+
return self._element.get("publicId", "")
|
176 |
+
|
177 |
+
def _setPublicId(self, value):
|
178 |
+
if value is not None:
|
179 |
+
self._element.set("publicId", value)
|
180 |
+
|
181 |
+
publicId = property(_getPublicId, _setPublicId)
|
182 |
+
|
183 |
+
def _getSystemId(self):
|
184 |
+
return self._element.get("systemId", "")
|
185 |
+
|
186 |
+
def _setSystemId(self, value):
|
187 |
+
if value is not None:
|
188 |
+
self._element.set("systemId", value)
|
189 |
+
|
190 |
+
systemId = property(_getSystemId, _setSystemId)
|
191 |
+
|
192 |
+
class Document(Element):
|
193 |
+
def __init__(self):
|
194 |
+
Element.__init__(self, "DOCUMENT_ROOT")
|
195 |
+
|
196 |
+
class DocumentFragment(Element):
|
197 |
+
def __init__(self):
|
198 |
+
Element.__init__(self, "DOCUMENT_FRAGMENT")
|
199 |
+
|
200 |
+
def testSerializer(element):
|
201 |
+
rv = []
|
202 |
+
|
203 |
+
def serializeElement(element, indent=0):
|
204 |
+
if not(hasattr(element, "tag")):
|
205 |
+
element = element.getroot()
|
206 |
+
if element.tag == "<!DOCTYPE>":
|
207 |
+
if element.get("publicId") or element.get("systemId"):
|
208 |
+
publicId = element.get("publicId") or ""
|
209 |
+
systemId = element.get("systemId") or ""
|
210 |
+
rv.append("""<!DOCTYPE %s "%s" "%s">""" %
|
211 |
+
(element.text, publicId, systemId))
|
212 |
+
else:
|
213 |
+
rv.append("<!DOCTYPE %s>" % (element.text,))
|
214 |
+
elif element.tag == "DOCUMENT_ROOT":
|
215 |
+
rv.append("#document")
|
216 |
+
if element.text is not None:
|
217 |
+
rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
|
218 |
+
if element.tail is not None:
|
219 |
+
raise TypeError("Document node cannot have tail")
|
220 |
+
if hasattr(element, "attrib") and len(element.attrib):
|
221 |
+
raise TypeError("Document node cannot have attributes")
|
222 |
+
elif element.tag == ElementTreeCommentType:
|
223 |
+
rv.append("|%s<!-- %s -->" % (' ' * indent, element.text))
|
224 |
+
else:
|
225 |
+
assert isinstance(element.tag, text_type), \
|
226 |
+
"Expected unicode, got %s, %s" % (type(element.tag), element.tag)
|
227 |
+
nsmatch = tag_regexp.match(element.tag)
|
228 |
+
|
229 |
+
if nsmatch is None:
|
230 |
+
name = element.tag
|
231 |
+
else:
|
232 |
+
ns, name = nsmatch.groups()
|
233 |
+
prefix = constants.prefixes[ns]
|
234 |
+
name = "%s %s" % (prefix, name)
|
235 |
+
rv.append("|%s<%s>" % (' ' * indent, name))
|
236 |
+
|
237 |
+
if hasattr(element, "attrib"):
|
238 |
+
attributes = []
|
239 |
+
for name, value in element.attrib.items():
|
240 |
+
nsmatch = tag_regexp.match(name)
|
241 |
+
if nsmatch is not None:
|
242 |
+
ns, name = nsmatch.groups()
|
243 |
+
prefix = constants.prefixes[ns]
|
244 |
+
attr_string = "%s %s" % (prefix, name)
|
245 |
+
else:
|
246 |
+
attr_string = name
|
247 |
+
attributes.append((attr_string, value))
|
248 |
+
|
249 |
+
for name, value in sorted(attributes):
|
250 |
+
rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
|
251 |
+
if element.text:
|
252 |
+
rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
|
253 |
+
indent += 2
|
254 |
+
for child in element:
|
255 |
+
serializeElement(child, indent)
|
256 |
+
if element.tail:
|
257 |
+
rv.append("|%s\"%s\"" % (' ' * (indent - 2), element.tail))
|
258 |
+
serializeElement(element, 0)
|
259 |
+
|
260 |
+
return "\n".join(rv)
|
261 |
+
|
262 |
+
def tostring(element): # pylint:disable=unused-variable
|
263 |
+
"""Serialize an element and its child nodes to a string"""
|
264 |
+
rv = []
|
265 |
+
filter = _ihatexml.InfosetFilter()
|
266 |
+
|
267 |
+
def serializeElement(element):
|
268 |
+
if isinstance(element, ElementTree.ElementTree):
|
269 |
+
element = element.getroot()
|
270 |
+
|
271 |
+
if element.tag == "<!DOCTYPE>":
|
272 |
+
if element.get("publicId") or element.get("systemId"):
|
273 |
+
publicId = element.get("publicId") or ""
|
274 |
+
systemId = element.get("systemId") or ""
|
275 |
+
rv.append("""<!DOCTYPE %s PUBLIC "%s" "%s">""" %
|
276 |
+
(element.text, publicId, systemId))
|
277 |
+
else:
|
278 |
+
rv.append("<!DOCTYPE %s>" % (element.text,))
|
279 |
+
elif element.tag == "DOCUMENT_ROOT":
|
280 |
+
if element.text is not None:
|
281 |
+
rv.append(element.text)
|
282 |
+
if element.tail is not None:
|
283 |
+
raise TypeError("Document node cannot have tail")
|
284 |
+
if hasattr(element, "attrib") and len(element.attrib):
|
285 |
+
raise TypeError("Document node cannot have attributes")
|
286 |
+
|
287 |
+
for child in element:
|
288 |
+
serializeElement(child)
|
289 |
+
|
290 |
+
elif element.tag == ElementTreeCommentType:
|
291 |
+
rv.append("<!--%s-->" % (element.text,))
|
292 |
+
else:
|
293 |
+
# This is assumed to be an ordinary element
|
294 |
+
if not element.attrib:
|
295 |
+
rv.append("<%s>" % (filter.fromXmlName(element.tag),))
|
296 |
+
else:
|
297 |
+
attr = " ".join(["%s=\"%s\"" % (
|
298 |
+
filter.fromXmlName(name), value)
|
299 |
+
for name, value in element.attrib.items()])
|
300 |
+
rv.append("<%s %s>" % (element.tag, attr))
|
301 |
+
if element.text:
|
302 |
+
rv.append(element.text)
|
303 |
+
|
304 |
+
for child in element:
|
305 |
+
serializeElement(child)
|
306 |
+
|
307 |
+
rv.append("</%s>" % (element.tag,))
|
308 |
+
|
309 |
+
if element.tail:
|
310 |
+
rv.append(element.tail)
|
311 |
+
|
312 |
+
serializeElement(element)
|
313 |
+
|
314 |
+
return "".join(rv)
|
315 |
+
|
316 |
+
class TreeBuilder(base.TreeBuilder): # pylint:disable=unused-variable
|
317 |
+
documentClass = Document
|
318 |
+
doctypeClass = DocumentType
|
319 |
+
elementClass = Element
|
320 |
+
commentClass = Comment
|
321 |
+
fragmentClass = DocumentFragment
|
322 |
+
implementation = ElementTreeImplementation
|
323 |
+
|
324 |
+
def testSerializer(self, element):
|
325 |
+
return testSerializer(element)
|
326 |
+
|
327 |
+
def getDocument(self):
|
328 |
+
if fullTree:
|
329 |
+
return self.document._element
|
330 |
+
else:
|
331 |
+
if self.defaultNamespace is not None:
|
332 |
+
return self.document._element.find(
|
333 |
+
"{%s}html" % self.defaultNamespace)
|
334 |
+
else:
|
335 |
+
return self.document._element.find("html")
|
336 |
+
|
337 |
+
def getFragment(self):
|
338 |
+
return base.TreeBuilder.getFragment(self)._element
|
339 |
+
|
340 |
+
return locals()
|
341 |
+
|
342 |
+
|
343 |
+
getETreeModule = moduleFactoryFactory(getETreeBuilder)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
ADDED
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Module for supporting the lxml.etree library. The idea here is to use as much
|
2 |
+
of the native library as possible, without using fragile hacks like custom element
|
3 |
+
names that break between releases. The downside of this is that we cannot represent
|
4 |
+
all possible trees; specifically the following are known to cause problems:
|
5 |
+
|
6 |
+
Text or comments as siblings of the root element
|
7 |
+
Docypes with no name
|
8 |
+
|
9 |
+
When any of these things occur, we emit a DataLossWarning
|
10 |
+
"""
|
11 |
+
|
12 |
+
from __future__ import absolute_import, division, unicode_literals
|
13 |
+
# pylint:disable=protected-access
|
14 |
+
|
15 |
+
import warnings
|
16 |
+
import re
|
17 |
+
import sys
|
18 |
+
|
19 |
+
try:
|
20 |
+
from collections.abc import MutableMapping
|
21 |
+
except ImportError:
|
22 |
+
from collections import MutableMapping
|
23 |
+
|
24 |
+
from . import base
|
25 |
+
from ..constants import DataLossWarning
|
26 |
+
from .. import constants
|
27 |
+
from . import etree as etree_builders
|
28 |
+
from .. import _ihatexml
|
29 |
+
|
30 |
+
import lxml.etree as etree
|
31 |
+
from pip._vendor.six import PY3, binary_type
|
32 |
+
|
33 |
+
|
34 |
+
fullTree = True
|
35 |
+
tag_regexp = re.compile("{([^}]*)}(.*)")
|
36 |
+
|
37 |
+
comment_type = etree.Comment("asd").tag
|
38 |
+
|
39 |
+
|
40 |
+
class DocumentType(object):
|
41 |
+
def __init__(self, name, publicId, systemId):
|
42 |
+
self.name = name
|
43 |
+
self.publicId = publicId
|
44 |
+
self.systemId = systemId
|
45 |
+
|
46 |
+
|
47 |
+
class Document(object):
|
48 |
+
def __init__(self):
|
49 |
+
self._elementTree = None
|
50 |
+
self._childNodes = []
|
51 |
+
|
52 |
+
def appendChild(self, element):
|
53 |
+
last = self._elementTree.getroot()
|
54 |
+
for last in self._elementTree.getroot().itersiblings():
|
55 |
+
pass
|
56 |
+
|
57 |
+
last.addnext(element._element)
|
58 |
+
|
59 |
+
def _getChildNodes(self):
|
60 |
+
return self._childNodes
|
61 |
+
|
62 |
+
childNodes = property(_getChildNodes)
|
63 |
+
|
64 |
+
|
65 |
+
def testSerializer(element):
|
66 |
+
rv = []
|
67 |
+
infosetFilter = _ihatexml.InfosetFilter(preventDoubleDashComments=True)
|
68 |
+
|
69 |
+
def serializeElement(element, indent=0):
|
70 |
+
if not hasattr(element, "tag"):
|
71 |
+
if hasattr(element, "getroot"):
|
72 |
+
# Full tree case
|
73 |
+
rv.append("#document")
|
74 |
+
if element.docinfo.internalDTD:
|
75 |
+
if not (element.docinfo.public_id or
|
76 |
+
element.docinfo.system_url):
|
77 |
+
dtd_str = "<!DOCTYPE %s>" % element.docinfo.root_name
|
78 |
+
else:
|
79 |
+
dtd_str = """<!DOCTYPE %s "%s" "%s">""" % (
|
80 |
+
element.docinfo.root_name,
|
81 |
+
element.docinfo.public_id,
|
82 |
+
element.docinfo.system_url)
|
83 |
+
rv.append("|%s%s" % (' ' * (indent + 2), dtd_str))
|
84 |
+
next_element = element.getroot()
|
85 |
+
while next_element.getprevious() is not None:
|
86 |
+
next_element = next_element.getprevious()
|
87 |
+
while next_element is not None:
|
88 |
+
serializeElement(next_element, indent + 2)
|
89 |
+
next_element = next_element.getnext()
|
90 |
+
elif isinstance(element, str) or isinstance(element, bytes):
|
91 |
+
# Text in a fragment
|
92 |
+
assert isinstance(element, str) or sys.version_info[0] == 2
|
93 |
+
rv.append("|%s\"%s\"" % (' ' * indent, element))
|
94 |
+
else:
|
95 |
+
# Fragment case
|
96 |
+
rv.append("#document-fragment")
|
97 |
+
for next_element in element:
|
98 |
+
serializeElement(next_element, indent + 2)
|
99 |
+
elif element.tag == comment_type:
|
100 |
+
rv.append("|%s<!-- %s -->" % (' ' * indent, element.text))
|
101 |
+
if hasattr(element, "tail") and element.tail:
|
102 |
+
rv.append("|%s\"%s\"" % (' ' * indent, element.tail))
|
103 |
+
else:
|
104 |
+
assert isinstance(element, etree._Element)
|
105 |
+
nsmatch = etree_builders.tag_regexp.match(element.tag)
|
106 |
+
if nsmatch is not None:
|
107 |
+
ns = nsmatch.group(1)
|
108 |
+
tag = nsmatch.group(2)
|
109 |
+
prefix = constants.prefixes[ns]
|
110 |
+
rv.append("|%s<%s %s>" % (' ' * indent, prefix,
|
111 |
+
infosetFilter.fromXmlName(tag)))
|
112 |
+
else:
|
113 |
+
rv.append("|%s<%s>" % (' ' * indent,
|
114 |
+
infosetFilter.fromXmlName(element.tag)))
|
115 |
+
|
116 |
+
if hasattr(element, "attrib"):
|
117 |
+
attributes = []
|
118 |
+
for name, value in element.attrib.items():
|
119 |
+
nsmatch = tag_regexp.match(name)
|
120 |
+
if nsmatch is not None:
|
121 |
+
ns, name = nsmatch.groups()
|
122 |
+
name = infosetFilter.fromXmlName(name)
|
123 |
+
prefix = constants.prefixes[ns]
|
124 |
+
attr_string = "%s %s" % (prefix, name)
|
125 |
+
else:
|
126 |
+
attr_string = infosetFilter.fromXmlName(name)
|
127 |
+
attributes.append((attr_string, value))
|
128 |
+
|
129 |
+
for name, value in sorted(attributes):
|
130 |
+
rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
|
131 |
+
|
132 |
+
if element.text:
|
133 |
+
rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
|
134 |
+
indent += 2
|
135 |
+
for child in element:
|
136 |
+
serializeElement(child, indent)
|
137 |
+
if hasattr(element, "tail") and element.tail:
|
138 |
+
rv.append("|%s\"%s\"" % (' ' * (indent - 2), element.tail))
|
139 |
+
serializeElement(element, 0)
|
140 |
+
|
141 |
+
return "\n".join(rv)
|
142 |
+
|
143 |
+
|
144 |
+
def tostring(element):
|
145 |
+
"""Serialize an element and its child nodes to a string"""
|
146 |
+
rv = []
|
147 |
+
|
148 |
+
def serializeElement(element):
|
149 |
+
if not hasattr(element, "tag"):
|
150 |
+
if element.docinfo.internalDTD:
|
151 |
+
if element.docinfo.doctype:
|
152 |
+
dtd_str = element.docinfo.doctype
|
153 |
+
else:
|
154 |
+
dtd_str = "<!DOCTYPE %s>" % element.docinfo.root_name
|
155 |
+
rv.append(dtd_str)
|
156 |
+
serializeElement(element.getroot())
|
157 |
+
|
158 |
+
elif element.tag == comment_type:
|
159 |
+
rv.append("<!--%s-->" % (element.text,))
|
160 |
+
|
161 |
+
else:
|
162 |
+
# This is assumed to be an ordinary element
|
163 |
+
if not element.attrib:
|
164 |
+
rv.append("<%s>" % (element.tag,))
|
165 |
+
else:
|
166 |
+
attr = " ".join(["%s=\"%s\"" % (name, value)
|
167 |
+
for name, value in element.attrib.items()])
|
168 |
+
rv.append("<%s %s>" % (element.tag, attr))
|
169 |
+
if element.text:
|
170 |
+
rv.append(element.text)
|
171 |
+
|
172 |
+
for child in element:
|
173 |
+
serializeElement(child)
|
174 |
+
|
175 |
+
rv.append("</%s>" % (element.tag,))
|
176 |
+
|
177 |
+
if hasattr(element, "tail") and element.tail:
|
178 |
+
rv.append(element.tail)
|
179 |
+
|
180 |
+
serializeElement(element)
|
181 |
+
|
182 |
+
return "".join(rv)
|
183 |
+
|
184 |
+
|
185 |
+
class TreeBuilder(base.TreeBuilder):
|
186 |
+
documentClass = Document
|
187 |
+
doctypeClass = DocumentType
|
188 |
+
elementClass = None
|
189 |
+
commentClass = None
|
190 |
+
fragmentClass = Document
|
191 |
+
implementation = etree
|
192 |
+
|
193 |
+
def __init__(self, namespaceHTMLElements, fullTree=False):
|
194 |
+
builder = etree_builders.getETreeModule(etree, fullTree=fullTree)
|
195 |
+
infosetFilter = self.infosetFilter = _ihatexml.InfosetFilter(preventDoubleDashComments=True)
|
196 |
+
self.namespaceHTMLElements = namespaceHTMLElements
|
197 |
+
|
198 |
+
class Attributes(MutableMapping):
|
199 |
+
def __init__(self, element):
|
200 |
+
self._element = element
|
201 |
+
|
202 |
+
def _coerceKey(self, key):
|
203 |
+
if isinstance(key, tuple):
|
204 |
+
name = "{%s}%s" % (key[2], infosetFilter.coerceAttribute(key[1]))
|
205 |
+
else:
|
206 |
+
name = infosetFilter.coerceAttribute(key)
|
207 |
+
return name
|
208 |
+
|
209 |
+
def __getitem__(self, key):
|
210 |
+
value = self._element._element.attrib[self._coerceKey(key)]
|
211 |
+
if not PY3 and isinstance(value, binary_type):
|
212 |
+
value = value.decode("ascii")
|
213 |
+
return value
|
214 |
+
|
215 |
+
def __setitem__(self, key, value):
|
216 |
+
self._element._element.attrib[self._coerceKey(key)] = value
|
217 |
+
|
218 |
+
def __delitem__(self, key):
|
219 |
+
del self._element._element.attrib[self._coerceKey(key)]
|
220 |
+
|
221 |
+
def __iter__(self):
|
222 |
+
return iter(self._element._element.attrib)
|
223 |
+
|
224 |
+
def __len__(self):
|
225 |
+
return len(self._element._element.attrib)
|
226 |
+
|
227 |
+
def clear(self):
|
228 |
+
return self._element._element.attrib.clear()
|
229 |
+
|
230 |
+
class Element(builder.Element):
|
231 |
+
def __init__(self, name, namespace):
|
232 |
+
name = infosetFilter.coerceElement(name)
|
233 |
+
builder.Element.__init__(self, name, namespace=namespace)
|
234 |
+
self._attributes = Attributes(self)
|
235 |
+
|
236 |
+
def _setName(self, name):
|
237 |
+
self._name = infosetFilter.coerceElement(name)
|
238 |
+
self._element.tag = self._getETreeTag(
|
239 |
+
self._name, self._namespace)
|
240 |
+
|
241 |
+
def _getName(self):
|
242 |
+
return infosetFilter.fromXmlName(self._name)
|
243 |
+
|
244 |
+
name = property(_getName, _setName)
|
245 |
+
|
246 |
+
def _getAttributes(self):
|
247 |
+
return self._attributes
|
248 |
+
|
249 |
+
def _setAttributes(self, value):
|
250 |
+
attributes = self.attributes
|
251 |
+
attributes.clear()
|
252 |
+
attributes.update(value)
|
253 |
+
|
254 |
+
attributes = property(_getAttributes, _setAttributes)
|
255 |
+
|
256 |
+
def insertText(self, data, insertBefore=None):
|
257 |
+
data = infosetFilter.coerceCharacters(data)
|
258 |
+
builder.Element.insertText(self, data, insertBefore)
|
259 |
+
|
260 |
+
def cloneNode(self):
|
261 |
+
element = type(self)(self.name, self.namespace)
|
262 |
+
if self._element.attrib:
|
263 |
+
element._element.attrib.update(self._element.attrib)
|
264 |
+
return element
|
265 |
+
|
266 |
+
class Comment(builder.Comment):
|
267 |
+
def __init__(self, data):
|
268 |
+
data = infosetFilter.coerceComment(data)
|
269 |
+
builder.Comment.__init__(self, data)
|
270 |
+
|
271 |
+
def _setData(self, data):
|
272 |
+
data = infosetFilter.coerceComment(data)
|
273 |
+
self._element.text = data
|
274 |
+
|
275 |
+
def _getData(self):
|
276 |
+
return self._element.text
|
277 |
+
|
278 |
+
data = property(_getData, _setData)
|
279 |
+
|
280 |
+
self.elementClass = Element
|
281 |
+
self.commentClass = Comment
|
282 |
+
# self.fragmentClass = builder.DocumentFragment
|
283 |
+
base.TreeBuilder.__init__(self, namespaceHTMLElements)
|
284 |
+
|
285 |
+
def reset(self):
|
286 |
+
base.TreeBuilder.reset(self)
|
287 |
+
self.insertComment = self.insertCommentInitial
|
288 |
+
self.initial_comments = []
|
289 |
+
self.doctype = None
|
290 |
+
|
291 |
+
def testSerializer(self, element):
|
292 |
+
return testSerializer(element)
|
293 |
+
|
294 |
+
def getDocument(self):
|
295 |
+
if fullTree:
|
296 |
+
return self.document._elementTree
|
297 |
+
else:
|
298 |
+
return self.document._elementTree.getroot()
|
299 |
+
|
300 |
+
def getFragment(self):
|
301 |
+
fragment = []
|
302 |
+
element = self.openElements[0]._element
|
303 |
+
if element.text:
|
304 |
+
fragment.append(element.text)
|
305 |
+
fragment.extend(list(element))
|
306 |
+
if element.tail:
|
307 |
+
fragment.append(element.tail)
|
308 |
+
return fragment
|
309 |
+
|
310 |
+
def insertDoctype(self, token):
|
311 |
+
name = token["name"]
|
312 |
+
publicId = token["publicId"]
|
313 |
+
systemId = token["systemId"]
|
314 |
+
|
315 |
+
if not name:
|
316 |
+
warnings.warn("lxml cannot represent empty doctype", DataLossWarning)
|
317 |
+
self.doctype = None
|
318 |
+
else:
|
319 |
+
coercedName = self.infosetFilter.coerceElement(name)
|
320 |
+
if coercedName != name:
|
321 |
+
warnings.warn("lxml cannot represent non-xml doctype", DataLossWarning)
|
322 |
+
|
323 |
+
doctype = self.doctypeClass(coercedName, publicId, systemId)
|
324 |
+
self.doctype = doctype
|
325 |
+
|
326 |
+
def insertCommentInitial(self, data, parent=None):
|
327 |
+
assert parent is None or parent is self.document
|
328 |
+
assert self.document._elementTree is None
|
329 |
+
self.initial_comments.append(data)
|
330 |
+
|
331 |
+
def insertCommentMain(self, data, parent=None):
|
332 |
+
if (parent == self.document and
|
333 |
+
self.document._elementTree.getroot()[-1].tag == comment_type):
|
334 |
+
warnings.warn("lxml cannot represent adjacent comments beyond the root elements", DataLossWarning)
|
335 |
+
super(TreeBuilder, self).insertComment(data, parent)
|
336 |
+
|
337 |
+
def insertRoot(self, token):
|
338 |
+
# Because of the way libxml2 works, it doesn't seem to be possible to
|
339 |
+
# alter information like the doctype after the tree has been parsed.
|
340 |
+
# Therefore we need to use the built-in parser to create our initial
|
341 |
+
# tree, after which we can add elements like normal
|
342 |
+
docStr = ""
|
343 |
+
if self.doctype:
|
344 |
+
assert self.doctype.name
|
345 |
+
docStr += "<!DOCTYPE %s" % self.doctype.name
|
346 |
+
if (self.doctype.publicId is not None or
|
347 |
+
self.doctype.systemId is not None):
|
348 |
+
docStr += (' PUBLIC "%s" ' %
|
349 |
+
(self.infosetFilter.coercePubid(self.doctype.publicId or "")))
|
350 |
+
if self.doctype.systemId:
|
351 |
+
sysid = self.doctype.systemId
|
352 |
+
if sysid.find("'") >= 0 and sysid.find('"') >= 0:
|
353 |
+
warnings.warn("DOCTYPE system cannot contain single and double quotes", DataLossWarning)
|
354 |
+
sysid = sysid.replace("'", 'U00027')
|
355 |
+
if sysid.find("'") >= 0:
|
356 |
+
docStr += '"%s"' % sysid
|
357 |
+
else:
|
358 |
+
docStr += "'%s'" % sysid
|
359 |
+
else:
|
360 |
+
docStr += "''"
|
361 |
+
docStr += ">"
|
362 |
+
if self.doctype.name != token["name"]:
|
363 |
+
warnings.warn("lxml cannot represent doctype with a different name to the root element", DataLossWarning)
|
364 |
+
docStr += "<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>"
|
365 |
+
root = etree.fromstring(docStr)
|
366 |
+
|
367 |
+
# Append the initial comments:
|
368 |
+
for comment_token in self.initial_comments:
|
369 |
+
comment = self.commentClass(comment_token["data"])
|
370 |
+
root.addprevious(comment._element)
|
371 |
+
|
372 |
+
# Create the root document and add the ElementTree to it
|
373 |
+
self.document = self.documentClass()
|
374 |
+
self.document._elementTree = root.getroottree()
|
375 |
+
|
376 |
+
# Give the root element the right name
|
377 |
+
name = token["name"]
|
378 |
+
namespace = token.get("namespace", self.defaultNamespace)
|
379 |
+
if namespace is None:
|
380 |
+
etree_tag = name
|
381 |
+
else:
|
382 |
+
etree_tag = "{%s}%s" % (namespace, name)
|
383 |
+
root.tag = etree_tag
|
384 |
+
|
385 |
+
# Add the root element to the internal child/open data structures
|
386 |
+
root_element = self.elementClass(name, namespace)
|
387 |
+
root_element._element = root
|
388 |
+
self.document._childNodes.append(root_element)
|
389 |
+
self.openElements.append(root_element)
|
390 |
+
|
391 |
+
# Reset to the default insert comment function
|
392 |
+
self.insertComment = self.insertCommentMain
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (3.98 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-310.pyc
ADDED
Binary file (6.94 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-310.pyc
ADDED
Binary file (1.91 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__init__.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .package_data import __version__
|
2 |
+
from .core import (
|
3 |
+
IDNABidiError,
|
4 |
+
IDNAError,
|
5 |
+
InvalidCodepoint,
|
6 |
+
InvalidCodepointContext,
|
7 |
+
alabel,
|
8 |
+
check_bidi,
|
9 |
+
check_hyphen_ok,
|
10 |
+
check_initial_combiner,
|
11 |
+
check_label,
|
12 |
+
check_nfc,
|
13 |
+
decode,
|
14 |
+
encode,
|
15 |
+
ulabel,
|
16 |
+
uts46_remap,
|
17 |
+
valid_contextj,
|
18 |
+
valid_contexto,
|
19 |
+
valid_label_length,
|
20 |
+
valid_string_length,
|
21 |
+
)
|
22 |
+
from .intranges import intranges_contain
|
23 |
+
|
24 |
+
__all__ = [
|
25 |
+
"IDNABidiError",
|
26 |
+
"IDNAError",
|
27 |
+
"InvalidCodepoint",
|
28 |
+
"InvalidCodepointContext",
|
29 |
+
"alabel",
|
30 |
+
"check_bidi",
|
31 |
+
"check_hyphen_ok",
|
32 |
+
"check_initial_combiner",
|
33 |
+
"check_label",
|
34 |
+
"check_nfc",
|
35 |
+
"decode",
|
36 |
+
"encode",
|
37 |
+
"intranges_contain",
|
38 |
+
"ulabel",
|
39 |
+
"uts46_remap",
|
40 |
+
"valid_contextj",
|
41 |
+
"valid_contexto",
|
42 |
+
"valid_label_length",
|
43 |
+
"valid_string_length",
|
44 |
+
]
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (840 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/core.cpython-310.pyc
ADDED
Binary file (9.56 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-310.pyc
ADDED
Binary file (38.2 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-310.pyc
ADDED
Binary file (1.98 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/codec.py
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .core import encode, decode, alabel, ulabel, IDNAError
|
2 |
+
import codecs
|
3 |
+
import re
|
4 |
+
from typing import Tuple, Optional
|
5 |
+
|
6 |
+
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
|
7 |
+
|
8 |
+
class Codec(codecs.Codec):
|
9 |
+
|
10 |
+
def encode(self, data: str, errors: str = 'strict') -> Tuple[bytes, int]:
|
11 |
+
if errors != 'strict':
|
12 |
+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
|
13 |
+
|
14 |
+
if not data:
|
15 |
+
return b"", 0
|
16 |
+
|
17 |
+
return encode(data), len(data)
|
18 |
+
|
19 |
+
def decode(self, data: bytes, errors: str = 'strict') -> Tuple[str, int]:
|
20 |
+
if errors != 'strict':
|
21 |
+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
|
22 |
+
|
23 |
+
if not data:
|
24 |
+
return '', 0
|
25 |
+
|
26 |
+
return decode(data), len(data)
|
27 |
+
|
28 |
+
class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
|
29 |
+
def _buffer_encode(self, data: str, errors: str, final: bool) -> Tuple[str, int]: # type: ignore
|
30 |
+
if errors != 'strict':
|
31 |
+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
|
32 |
+
|
33 |
+
if not data:
|
34 |
+
return "", 0
|
35 |
+
|
36 |
+
labels = _unicode_dots_re.split(data)
|
37 |
+
trailing_dot = ''
|
38 |
+
if labels:
|
39 |
+
if not labels[-1]:
|
40 |
+
trailing_dot = '.'
|
41 |
+
del labels[-1]
|
42 |
+
elif not final:
|
43 |
+
# Keep potentially unfinished label until the next call
|
44 |
+
del labels[-1]
|
45 |
+
if labels:
|
46 |
+
trailing_dot = '.'
|
47 |
+
|
48 |
+
result = []
|
49 |
+
size = 0
|
50 |
+
for label in labels:
|
51 |
+
result.append(alabel(label))
|
52 |
+
if size:
|
53 |
+
size += 1
|
54 |
+
size += len(label)
|
55 |
+
|
56 |
+
# Join with U+002E
|
57 |
+
result_str = '.'.join(result) + trailing_dot # type: ignore
|
58 |
+
size += len(trailing_dot)
|
59 |
+
return result_str, size
|
60 |
+
|
61 |
+
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
|
62 |
+
def _buffer_decode(self, data: str, errors: str, final: bool) -> Tuple[str, int]: # type: ignore
|
63 |
+
if errors != 'strict':
|
64 |
+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
|
65 |
+
|
66 |
+
if not data:
|
67 |
+
return ('', 0)
|
68 |
+
|
69 |
+
labels = _unicode_dots_re.split(data)
|
70 |
+
trailing_dot = ''
|
71 |
+
if labels:
|
72 |
+
if not labels[-1]:
|
73 |
+
trailing_dot = '.'
|
74 |
+
del labels[-1]
|
75 |
+
elif not final:
|
76 |
+
# Keep potentially unfinished label until the next call
|
77 |
+
del labels[-1]
|
78 |
+
if labels:
|
79 |
+
trailing_dot = '.'
|
80 |
+
|
81 |
+
result = []
|
82 |
+
size = 0
|
83 |
+
for label in labels:
|
84 |
+
result.append(ulabel(label))
|
85 |
+
if size:
|
86 |
+
size += 1
|
87 |
+
size += len(label)
|
88 |
+
|
89 |
+
result_str = '.'.join(result) + trailing_dot
|
90 |
+
size += len(trailing_dot)
|
91 |
+
return (result_str, size)
|
92 |
+
|
93 |
+
|
94 |
+
class StreamWriter(Codec, codecs.StreamWriter):
|
95 |
+
pass
|
96 |
+
|
97 |
+
|
98 |
+
class StreamReader(Codec, codecs.StreamReader):
|
99 |
+
pass
|
100 |
+
|
101 |
+
|
102 |
+
def getregentry() -> codecs.CodecInfo:
|
103 |
+
# Compatibility as a search_function for codecs.register()
|
104 |
+
return codecs.CodecInfo(
|
105 |
+
name='idna',
|
106 |
+
encode=Codec().encode, # type: ignore
|
107 |
+
decode=Codec().decode, # type: ignore
|
108 |
+
incrementalencoder=IncrementalEncoder,
|
109 |
+
incrementaldecoder=IncrementalDecoder,
|
110 |
+
streamwriter=StreamWriter,
|
111 |
+
streamreader=StreamReader,
|
112 |
+
)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/compat.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .core import *
|
2 |
+
from .codec import *
|
3 |
+
from typing import Any, Union
|
4 |
+
|
5 |
+
def ToASCII(label: str) -> bytes:
|
6 |
+
return encode(label)
|
7 |
+
|
8 |
+
def ToUnicode(label: Union[bytes, bytearray]) -> str:
|
9 |
+
return decode(label)
|
10 |
+
|
11 |
+
def nameprep(s: Any) -> None:
|
12 |
+
raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol')
|
13 |
+
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/core.py
ADDED
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from . import idnadata
|
2 |
+
import bisect
|
3 |
+
import unicodedata
|
4 |
+
import re
|
5 |
+
from typing import Union, Optional
|
6 |
+
from .intranges import intranges_contain
|
7 |
+
|
8 |
+
_virama_combining_class = 9
|
9 |
+
_alabel_prefix = b'xn--'
|
10 |
+
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
|
11 |
+
|
12 |
+
class IDNAError(UnicodeError):
|
13 |
+
""" Base exception for all IDNA-encoding related problems """
|
14 |
+
pass
|
15 |
+
|
16 |
+
|
17 |
+
class IDNABidiError(IDNAError):
|
18 |
+
""" Exception when bidirectional requirements are not satisfied """
|
19 |
+
pass
|
20 |
+
|
21 |
+
|
22 |
+
class InvalidCodepoint(IDNAError):
|
23 |
+
""" Exception when a disallowed or unallocated codepoint is used """
|
24 |
+
pass
|
25 |
+
|
26 |
+
|
27 |
+
class InvalidCodepointContext(IDNAError):
|
28 |
+
""" Exception when the codepoint is not valid in the context it is used """
|
29 |
+
pass
|
30 |
+
|
31 |
+
|
32 |
+
def _combining_class(cp: int) -> int:
|
33 |
+
v = unicodedata.combining(chr(cp))
|
34 |
+
if v == 0:
|
35 |
+
if not unicodedata.name(chr(cp)):
|
36 |
+
raise ValueError('Unknown character in unicodedata')
|
37 |
+
return v
|
38 |
+
|
39 |
+
def _is_script(cp: str, script: str) -> bool:
|
40 |
+
return intranges_contain(ord(cp), idnadata.scripts[script])
|
41 |
+
|
42 |
+
def _punycode(s: str) -> bytes:
|
43 |
+
return s.encode('punycode')
|
44 |
+
|
45 |
+
def _unot(s: int) -> str:
|
46 |
+
return 'U+{:04X}'.format(s)
|
47 |
+
|
48 |
+
|
49 |
+
def valid_label_length(label: Union[bytes, str]) -> bool:
|
50 |
+
if len(label) > 63:
|
51 |
+
return False
|
52 |
+
return True
|
53 |
+
|
54 |
+
|
55 |
+
def valid_string_length(label: Union[bytes, str], trailing_dot: bool) -> bool:
|
56 |
+
if len(label) > (254 if trailing_dot else 253):
|
57 |
+
return False
|
58 |
+
return True
|
59 |
+
|
60 |
+
|
61 |
+
def check_bidi(label: str, check_ltr: bool = False) -> bool:
|
62 |
+
# Bidi rules should only be applied if string contains RTL characters
|
63 |
+
bidi_label = False
|
64 |
+
for (idx, cp) in enumerate(label, 1):
|
65 |
+
direction = unicodedata.bidirectional(cp)
|
66 |
+
if direction == '':
|
67 |
+
# String likely comes from a newer version of Unicode
|
68 |
+
raise IDNABidiError('Unknown directionality in label {} at position {}'.format(repr(label), idx))
|
69 |
+
if direction in ['R', 'AL', 'AN']:
|
70 |
+
bidi_label = True
|
71 |
+
if not bidi_label and not check_ltr:
|
72 |
+
return True
|
73 |
+
|
74 |
+
# Bidi rule 1
|
75 |
+
direction = unicodedata.bidirectional(label[0])
|
76 |
+
if direction in ['R', 'AL']:
|
77 |
+
rtl = True
|
78 |
+
elif direction == 'L':
|
79 |
+
rtl = False
|
80 |
+
else:
|
81 |
+
raise IDNABidiError('First codepoint in label {} must be directionality L, R or AL'.format(repr(label)))
|
82 |
+
|
83 |
+
valid_ending = False
|
84 |
+
number_type = None # type: Optional[str]
|
85 |
+
for (idx, cp) in enumerate(label, 1):
|
86 |
+
direction = unicodedata.bidirectional(cp)
|
87 |
+
|
88 |
+
if rtl:
|
89 |
+
# Bidi rule 2
|
90 |
+
if not direction in ['R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']:
|
91 |
+
raise IDNABidiError('Invalid direction for codepoint at position {} in a right-to-left label'.format(idx))
|
92 |
+
# Bidi rule 3
|
93 |
+
if direction in ['R', 'AL', 'EN', 'AN']:
|
94 |
+
valid_ending = True
|
95 |
+
elif direction != 'NSM':
|
96 |
+
valid_ending = False
|
97 |
+
# Bidi rule 4
|
98 |
+
if direction in ['AN', 'EN']:
|
99 |
+
if not number_type:
|
100 |
+
number_type = direction
|
101 |
+
else:
|
102 |
+
if number_type != direction:
|
103 |
+
raise IDNABidiError('Can not mix numeral types in a right-to-left label')
|
104 |
+
else:
|
105 |
+
# Bidi rule 5
|
106 |
+
if not direction in ['L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']:
|
107 |
+
raise IDNABidiError('Invalid direction for codepoint at position {} in a left-to-right label'.format(idx))
|
108 |
+
# Bidi rule 6
|
109 |
+
if direction in ['L', 'EN']:
|
110 |
+
valid_ending = True
|
111 |
+
elif direction != 'NSM':
|
112 |
+
valid_ending = False
|
113 |
+
|
114 |
+
if not valid_ending:
|
115 |
+
raise IDNABidiError('Label ends with illegal codepoint directionality')
|
116 |
+
|
117 |
+
return True
|
118 |
+
|
119 |
+
|
120 |
+
def check_initial_combiner(label: str) -> bool:
|
121 |
+
if unicodedata.category(label[0])[0] == 'M':
|
122 |
+
raise IDNAError('Label begins with an illegal combining character')
|
123 |
+
return True
|
124 |
+
|
125 |
+
|
126 |
+
def check_hyphen_ok(label: str) -> bool:
|
127 |
+
if label[2:4] == '--':
|
128 |
+
raise IDNAError('Label has disallowed hyphens in 3rd and 4th position')
|
129 |
+
if label[0] == '-' or label[-1] == '-':
|
130 |
+
raise IDNAError('Label must not start or end with a hyphen')
|
131 |
+
return True
|
132 |
+
|
133 |
+
|
134 |
+
def check_nfc(label: str) -> None:
|
135 |
+
if unicodedata.normalize('NFC', label) != label:
|
136 |
+
raise IDNAError('Label must be in Normalization Form C')
|
137 |
+
|
138 |
+
|
139 |
+
def valid_contextj(label: str, pos: int) -> bool:
|
140 |
+
cp_value = ord(label[pos])
|
141 |
+
|
142 |
+
if cp_value == 0x200c:
|
143 |
+
|
144 |
+
if pos > 0:
|
145 |
+
if _combining_class(ord(label[pos - 1])) == _virama_combining_class:
|
146 |
+
return True
|
147 |
+
|
148 |
+
ok = False
|
149 |
+
for i in range(pos-1, -1, -1):
|
150 |
+
joining_type = idnadata.joining_types.get(ord(label[i]))
|
151 |
+
if joining_type == ord('T'):
|
152 |
+
continue
|
153 |
+
if joining_type in [ord('L'), ord('D')]:
|
154 |
+
ok = True
|
155 |
+
break
|
156 |
+
|
157 |
+
if not ok:
|
158 |
+
return False
|
159 |
+
|
160 |
+
ok = False
|
161 |
+
for i in range(pos+1, len(label)):
|
162 |
+
joining_type = idnadata.joining_types.get(ord(label[i]))
|
163 |
+
if joining_type == ord('T'):
|
164 |
+
continue
|
165 |
+
if joining_type in [ord('R'), ord('D')]:
|
166 |
+
ok = True
|
167 |
+
break
|
168 |
+
return ok
|
169 |
+
|
170 |
+
if cp_value == 0x200d:
|
171 |
+
|
172 |
+
if pos > 0:
|
173 |
+
if _combining_class(ord(label[pos - 1])) == _virama_combining_class:
|
174 |
+
return True
|
175 |
+
return False
|
176 |
+
|
177 |
+
else:
|
178 |
+
|
179 |
+
return False
|
180 |
+
|
181 |
+
|
182 |
+
def valid_contexto(label: str, pos: int, exception: bool = False) -> bool:
|
183 |
+
cp_value = ord(label[pos])
|
184 |
+
|
185 |
+
if cp_value == 0x00b7:
|
186 |
+
if 0 < pos < len(label)-1:
|
187 |
+
if ord(label[pos - 1]) == 0x006c and ord(label[pos + 1]) == 0x006c:
|
188 |
+
return True
|
189 |
+
return False
|
190 |
+
|
191 |
+
elif cp_value == 0x0375:
|
192 |
+
if pos < len(label)-1 and len(label) > 1:
|
193 |
+
return _is_script(label[pos + 1], 'Greek')
|
194 |
+
return False
|
195 |
+
|
196 |
+
elif cp_value == 0x05f3 or cp_value == 0x05f4:
|
197 |
+
if pos > 0:
|
198 |
+
return _is_script(label[pos - 1], 'Hebrew')
|
199 |
+
return False
|
200 |
+
|
201 |
+
elif cp_value == 0x30fb:
|
202 |
+
for cp in label:
|
203 |
+
if cp == '\u30fb':
|
204 |
+
continue
|
205 |
+
if _is_script(cp, 'Hiragana') or _is_script(cp, 'Katakana') or _is_script(cp, 'Han'):
|
206 |
+
return True
|
207 |
+
return False
|
208 |
+
|
209 |
+
elif 0x660 <= cp_value <= 0x669:
|
210 |
+
for cp in label:
|
211 |
+
if 0x6f0 <= ord(cp) <= 0x06f9:
|
212 |
+
return False
|
213 |
+
return True
|
214 |
+
|
215 |
+
elif 0x6f0 <= cp_value <= 0x6f9:
|
216 |
+
for cp in label:
|
217 |
+
if 0x660 <= ord(cp) <= 0x0669:
|
218 |
+
return False
|
219 |
+
return True
|
220 |
+
|
221 |
+
return False
|
222 |
+
|
223 |
+
|
224 |
+
def check_label(label: Union[str, bytes, bytearray]) -> None:
|
225 |
+
if isinstance(label, (bytes, bytearray)):
|
226 |
+
label = label.decode('utf-8')
|
227 |
+
if len(label) == 0:
|
228 |
+
raise IDNAError('Empty Label')
|
229 |
+
|
230 |
+
check_nfc(label)
|
231 |
+
check_hyphen_ok(label)
|
232 |
+
check_initial_combiner(label)
|
233 |
+
|
234 |
+
for (pos, cp) in enumerate(label):
|
235 |
+
cp_value = ord(cp)
|
236 |
+
if intranges_contain(cp_value, idnadata.codepoint_classes['PVALID']):
|
237 |
+
continue
|
238 |
+
elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']):
|
239 |
+
try:
|
240 |
+
if not valid_contextj(label, pos):
|
241 |
+
raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format(
|
242 |
+
_unot(cp_value), pos+1, repr(label)))
|
243 |
+
except ValueError:
|
244 |
+
raise IDNAError('Unknown codepoint adjacent to joiner {} at position {} in {}'.format(
|
245 |
+
_unot(cp_value), pos+1, repr(label)))
|
246 |
+
elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']):
|
247 |
+
if not valid_contexto(label, pos):
|
248 |
+
raise InvalidCodepointContext('Codepoint {} not allowed at position {} in {}'.format(_unot(cp_value), pos+1, repr(label)))
|
249 |
+
else:
|
250 |
+
raise InvalidCodepoint('Codepoint {} at position {} of {} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
|
251 |
+
|
252 |
+
check_bidi(label)
|
253 |
+
|
254 |
+
|
255 |
+
def alabel(label: str) -> bytes:
|
256 |
+
try:
|
257 |
+
label_bytes = label.encode('ascii')
|
258 |
+
ulabel(label_bytes)
|
259 |
+
if not valid_label_length(label_bytes):
|
260 |
+
raise IDNAError('Label too long')
|
261 |
+
return label_bytes
|
262 |
+
except UnicodeEncodeError:
|
263 |
+
pass
|
264 |
+
|
265 |
+
if not label:
|
266 |
+
raise IDNAError('No Input')
|
267 |
+
|
268 |
+
label = str(label)
|
269 |
+
check_label(label)
|
270 |
+
label_bytes = _punycode(label)
|
271 |
+
label_bytes = _alabel_prefix + label_bytes
|
272 |
+
|
273 |
+
if not valid_label_length(label_bytes):
|
274 |
+
raise IDNAError('Label too long')
|
275 |
+
|
276 |
+
return label_bytes
|
277 |
+
|
278 |
+
|
279 |
+
def ulabel(label: Union[str, bytes, bytearray]) -> str:
|
280 |
+
if not isinstance(label, (bytes, bytearray)):
|
281 |
+
try:
|
282 |
+
label_bytes = label.encode('ascii')
|
283 |
+
except UnicodeEncodeError:
|
284 |
+
check_label(label)
|
285 |
+
return label
|
286 |
+
else:
|
287 |
+
label_bytes = label
|
288 |
+
|
289 |
+
label_bytes = label_bytes.lower()
|
290 |
+
if label_bytes.startswith(_alabel_prefix):
|
291 |
+
label_bytes = label_bytes[len(_alabel_prefix):]
|
292 |
+
if not label_bytes:
|
293 |
+
raise IDNAError('Malformed A-label, no Punycode eligible content found')
|
294 |
+
if label_bytes.decode('ascii')[-1] == '-':
|
295 |
+
raise IDNAError('A-label must not end with a hyphen')
|
296 |
+
else:
|
297 |
+
check_label(label_bytes)
|
298 |
+
return label_bytes.decode('ascii')
|
299 |
+
|
300 |
+
try:
|
301 |
+
label = label_bytes.decode('punycode')
|
302 |
+
except UnicodeError:
|
303 |
+
raise IDNAError('Invalid A-label')
|
304 |
+
check_label(label)
|
305 |
+
return label
|
306 |
+
|
307 |
+
|
308 |
+
def uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False) -> str:
|
309 |
+
"""Re-map the characters in the string according to UTS46 processing."""
|
310 |
+
from .uts46data import uts46data
|
311 |
+
output = ''
|
312 |
+
|
313 |
+
for pos, char in enumerate(domain):
|
314 |
+
code_point = ord(char)
|
315 |
+
try:
|
316 |
+
uts46row = uts46data[code_point if code_point < 256 else
|
317 |
+
bisect.bisect_left(uts46data, (code_point, 'Z')) - 1]
|
318 |
+
status = uts46row[1]
|
319 |
+
replacement = None # type: Optional[str]
|
320 |
+
if len(uts46row) == 3:
|
321 |
+
replacement = uts46row[2] # type: ignore
|
322 |
+
if (status == 'V' or
|
323 |
+
(status == 'D' and not transitional) or
|
324 |
+
(status == '3' and not std3_rules and replacement is None)):
|
325 |
+
output += char
|
326 |
+
elif replacement is not None and (status == 'M' or
|
327 |
+
(status == '3' and not std3_rules) or
|
328 |
+
(status == 'D' and transitional)):
|
329 |
+
output += replacement
|
330 |
+
elif status != 'I':
|
331 |
+
raise IndexError()
|
332 |
+
except IndexError:
|
333 |
+
raise InvalidCodepoint(
|
334 |
+
'Codepoint {} not allowed at position {} in {}'.format(
|
335 |
+
_unot(code_point), pos + 1, repr(domain)))
|
336 |
+
|
337 |
+
return unicodedata.normalize('NFC', output)
|
338 |
+
|
339 |
+
|
340 |
+
def encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False, transitional: bool = False) -> bytes:
|
341 |
+
if isinstance(s, (bytes, bytearray)):
|
342 |
+
s = s.decode('ascii')
|
343 |
+
if uts46:
|
344 |
+
s = uts46_remap(s, std3_rules, transitional)
|
345 |
+
trailing_dot = False
|
346 |
+
result = []
|
347 |
+
if strict:
|
348 |
+
labels = s.split('.')
|
349 |
+
else:
|
350 |
+
labels = _unicode_dots_re.split(s)
|
351 |
+
if not labels or labels == ['']:
|
352 |
+
raise IDNAError('Empty domain')
|
353 |
+
if labels[-1] == '':
|
354 |
+
del labels[-1]
|
355 |
+
trailing_dot = True
|
356 |
+
for label in labels:
|
357 |
+
s = alabel(label)
|
358 |
+
if s:
|
359 |
+
result.append(s)
|
360 |
+
else:
|
361 |
+
raise IDNAError('Empty label')
|
362 |
+
if trailing_dot:
|
363 |
+
result.append(b'')
|
364 |
+
s = b'.'.join(result)
|
365 |
+
if not valid_string_length(s, trailing_dot):
|
366 |
+
raise IDNAError('Domain too long')
|
367 |
+
return s
|
368 |
+
|
369 |
+
|
370 |
+
def decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False) -> str:
|
371 |
+
try:
|
372 |
+
if isinstance(s, (bytes, bytearray)):
|
373 |
+
s = s.decode('ascii')
|
374 |
+
except UnicodeDecodeError:
|
375 |
+
raise IDNAError('Invalid ASCII in A-label')
|
376 |
+
if uts46:
|
377 |
+
s = uts46_remap(s, std3_rules, False)
|
378 |
+
trailing_dot = False
|
379 |
+
result = []
|
380 |
+
if not strict:
|
381 |
+
labels = _unicode_dots_re.split(s)
|
382 |
+
else:
|
383 |
+
labels = s.split('.')
|
384 |
+
if not labels or labels == ['']:
|
385 |
+
raise IDNAError('Empty domain')
|
386 |
+
if not labels[-1]:
|
387 |
+
del labels[-1]
|
388 |
+
trailing_dot = True
|
389 |
+
for label in labels:
|
390 |
+
s = ulabel(label)
|
391 |
+
if s:
|
392 |
+
result.append(s)
|
393 |
+
else:
|
394 |
+
raise IDNAError('Empty label')
|
395 |
+
if tr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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file is automatically generated by tools/idna-data
|
2 |
+
|
3 |
+
__version__ = '14.0.0'
|
4 |
+
scripts = {
|
5 |
+
'Greek': (
|
6 |
+
0x37000000374,
|
7 |
+
0x37500000378,
|
8 |
+
0x37a0000037e,
|
9 |
+
0x37f00000380,
|
10 |
+
0x38400000385,
|
11 |
+
0x38600000387,
|
12 |
+
0x3880000038b,
|
13 |
+
0x38c0000038d,
|
14 |
+
0x38e000003a2,
|
15 |
+
0x3a3000003e2,
|
16 |
+
0x3f000000400,
|
17 |
+
0x1d2600001d2b,
|
18 |
+
0x1d5d00001d62,
|
19 |
+
0x1d6600001d6b,
|
20 |
+
0x1dbf00001dc0,
|
21 |
+
0x1f0000001f16,
|
22 |
+
0x1f1800001f1e,
|
23 |
+
0x1f2000001f46,
|
24 |
+
0x1f4800001f4e,
|
25 |
+
0x1f5000001f58,
|
26 |
+
0x1f5900001f5a,
|
27 |
+
0x1f5b00001f5c,
|
28 |
+
0x1f5d00001f5e,
|
29 |
+
0x1f5f00001f7e,
|
30 |
+
0x1f8000001fb5,
|
31 |
+
0x1fb600001fc5,
|
32 |
+
0x1fc600001fd4,
|
33 |
+
0x1fd600001fdc,
|
34 |
+
0x1fdd00001ff0,
|
35 |
+
0x1ff200001ff5,
|
36 |
+
0x1ff600001fff,
|
37 |
+
0x212600002127,
|
38 |
+
0xab650000ab66,
|
39 |
+
0x101400001018f,
|
40 |
+
0x101a0000101a1,
|
41 |
+
0x1d2000001d246,
|
42 |
+
),
|
43 |
+
'Han': (
|
44 |
+
0x2e8000002e9a,
|
45 |
+
0x2e9b00002ef4,
|
46 |
+
0x2f0000002fd6,
|
47 |
+
0x300500003006,
|
48 |
+
0x300700003008,
|
49 |
+
0x30210000302a,
|
50 |
+
0x30380000303c,
|
51 |
+
0x340000004dc0,
|
52 |
+
0x4e000000a000,
|
53 |
+
0xf9000000fa6e,
|
54 |
+
0xfa700000fada,
|
55 |
+
0x16fe200016fe4,
|
56 |
+
0x16ff000016ff2,
|
57 |
+
0x200000002a6e0,
|
58 |
+
0x2a7000002b739,
|
59 |
+
0x2b7400002b81e,
|
60 |
+
0x2b8200002cea2,
|
61 |
+
0x2ceb00002ebe1,
|
62 |
+
0x2f8000002fa1e,
|
63 |
+
0x300000003134b,
|
64 |
+
),
|
65 |
+
'Hebrew': (
|
66 |
+
0x591000005c8,
|
67 |
+
0x5d0000005eb,
|
68 |
+
0x5ef000005f5,
|
69 |
+
0xfb1d0000fb37,
|
70 |
+
0xfb380000fb3d,
|
71 |
+
0xfb3e0000fb3f,
|
72 |
+
0xfb400000fb42,
|
73 |
+
0xfb430000fb45,
|
74 |
+
0xfb460000fb50,
|
75 |
+
),
|
76 |
+
'Hiragana': (
|
77 |
+
0x304100003097,
|
78 |
+
0x309d000030a0,
|
79 |
+
0x1b0010001b120,
|
80 |
+
0x1b1500001b153,
|
81 |
+
0x1f2000001f201,
|
82 |
+
),
|
83 |
+
'Katakana': (
|
84 |
+
0x30a1000030fb,
|
85 |
+
0x30fd00003100,
|
86 |
+
0x31f000003200,
|
87 |
+
0x32d0000032ff,
|
88 |
+
0x330000003358,
|
89 |
+
0xff660000ff70,
|
90 |
+
0xff710000ff9e,
|
91 |
+
0x1aff00001aff4,
|
92 |
+
0x1aff50001affc,
|
93 |
+
0x1affd0001afff,
|
94 |
+
0x1b0000001b001,
|
95 |
+
0x1b1200001b123,
|
96 |
+
0x1b1640001b168,
|
97 |
+
),
|
98 |
+
}
|
99 |
+
joining_types = {
|
100 |
+
0x600: 85,
|
101 |
+
0x601: 85,
|
102 |
+
0x602: 85,
|
103 |
+
0x603: 85,
|
104 |
+
0x604: 85,
|
105 |
+
0x605: 85,
|
106 |
+
0x608: 85,
|
107 |
+
0x60b: 85,
|
108 |
+
0x620: 68,
|
109 |
+
0x621: 85,
|
110 |
+
0x622: 82,
|
111 |
+
0x623: 82,
|
112 |
+
0x624: 82,
|
113 |
+
0x625: 82,
|
114 |
+
0x626: 68,
|
115 |
+
0x627: 82,
|
116 |
+
0x628: 68,
|
117 |
+
0x629: 82,
|
118 |
+
0x62a: 68,
|
119 |
+
0x62b: 68,
|
120 |
+
0x62c: 68,
|
121 |
+
0x62d: 68,
|
122 |
+
0x62e: 68,
|
123 |
+
0x62f: 82,
|
124 |
+
0x630: 82,
|
125 |
+
0x631: 82,
|
126 |
+
0x632: 82,
|
127 |
+
0x633: 68,
|
128 |
+
0x634: 68,
|
129 |
+
0x635: 68,
|
130 |
+
0x636: 68,
|
131 |
+
0x637: 68,
|
132 |
+
0x638: 68,
|
133 |
+
0x639: 68,
|
134 |
+
0x63a: 68,
|
135 |
+
0x63b: 68,
|
136 |
+
0x63c: 68,
|
137 |
+
0x63d: 68,
|
138 |
+
0x63e: 68,
|
139 |
+
0x63f: 68,
|
140 |
+
0x640: 67,
|
141 |
+
0x641: 68,
|
142 |
+
0x642: 68,
|
143 |
+
0x643: 68,
|
144 |
+
0x644: 68,
|
145 |
+
0x645: 68,
|
146 |
+
0x646: 68,
|
147 |
+
0x647: 68,
|
148 |
+
0x648: 82,
|
149 |
+
0x649: 68,
|
150 |
+
0x64a: 68,
|
151 |
+
0x66e: 68,
|
152 |
+
0x66f: 68,
|
153 |
+
0x671: 82,
|
154 |
+
0x672: 82,
|
155 |
+
0x673: 82,
|
156 |
+
0x674: 85,
|
157 |
+
0x675: 82,
|
158 |
+
0x676: 82,
|
159 |
+
0x677: 82,
|
160 |
+
0x678: 68,
|
161 |
+
0x679: 68,
|
162 |
+
0x67a: 68,
|
163 |
+
0x67b: 68,
|
164 |
+
0x67c: 68,
|
165 |
+
0x67d: 68,
|
166 |
+
0x67e: 68,
|
167 |
+
0x67f: 68,
|
168 |
+
0x680: 68,
|
169 |
+
0x681: 68,
|
170 |
+
0x682: 68,
|
171 |
+
0x683: 68,
|
172 |
+
0x684: 68,
|
173 |
+
0x685: 68,
|
174 |
+
0x686: 68,
|
175 |
+
0x687: 68,
|
176 |
+
0x688: 82,
|
177 |
+
0x689: 82,
|
178 |
+
0x68a: 82,
|
179 |
+
0x68b: 82,
|
180 |
+
0x68c: 82,
|
181 |
+
0x68d: 82,
|
182 |
+
0x68e: 82,
|
183 |
+
0x68f: 82,
|
184 |
+
0x690: 82,
|
185 |
+
0x691: 82,
|
186 |
+
0x692: 82,
|
187 |
+
0x693: 82,
|
188 |
+
0x694: 82,
|
189 |
+
0x695: 82,
|
190 |
+
0x696: 82,
|
191 |
+
0x697: 82,
|
192 |
+
0x698: 82,
|
193 |
+
0x699: 82,
|
194 |
+
0x69a: 68,
|
195 |
+
0x69b: 68,
|
196 |
+
0x69c: 68,
|
197 |
+
0x69d: 68,
|
198 |
+
0x69e: 68,
|
199 |
+
0x69f: 68,
|
200 |
+
0x6a0: 68,
|
201 |
+
0x6a1: 68,
|
202 |
+
0x6a2: 68,
|
203 |
+
0x6a3: 68,
|
204 |
+
0x6a4: 68,
|
205 |
+
0x6a5: 68,
|
206 |
+
0x6a6: 68,
|
207 |
+
0x6a7: 68,
|
208 |
+
0x6a8: 68,
|
209 |
+
0x6a9: 68,
|
210 |
+
0x6aa: 68,
|
211 |
+
0x6ab: 68,
|
212 |
+
0x6ac: 68,
|
213 |
+
0x6ad: 68,
|
214 |
+
0x6ae: 68,
|
215 |
+
0x6af: 68,
|
216 |
+
0x6b0: 68,
|
217 |
+
0x6b1: 68,
|
218 |
+
0x6b2: 68,
|
219 |
+
0x6b3: 68,
|
220 |
+
0x6b4: 68,
|
221 |
+
0x6b5: 68,
|
222 |
+
0x6b6: 68,
|
223 |
+
0x6b7: 68,
|
224 |
+
0x6b8: 68,
|
225 |
+
0x6b9: 68,
|
226 |
+
0x6ba: 68,
|
227 |
+
0x6bb: 68,
|
228 |
+
0x6bc: 68,
|
229 |
+
0x6bd: 68,
|
230 |
+
0x6be: 68,
|
231 |
+
0x6bf: 68,
|
232 |
+
0x6c0: 82,
|
233 |
+
0x6c1: 68,
|
234 |
+
0x6c2: 68,
|
235 |
+
0x6c3: 82,
|
236 |
+
0x6c4: 82,
|
237 |
+
0x6c5: 82,
|
238 |
+
0x6c6: 82,
|
239 |
+
0x6c7: 82,
|
240 |
+
0x6c8: 82,
|
241 |
+
0x6c9: 82,
|
242 |
+
0x6ca: 82,
|
243 |
+
0x6cb: 82,
|
244 |
+
0x6cc: 68,
|
245 |
+
0x6cd: 82,
|
246 |
+
0x6ce: 68,
|
247 |
+
0x6cf: 82,
|
248 |
+
0x6d0: 68,
|
249 |
+
0x6d1: 68,
|
250 |
+
0x6d2: 82,
|
251 |
+
0x6d3: 82,
|
252 |
+
0x6d5: 82,
|
253 |
+
0x6dd: 85,
|
254 |
+
0x6ee: 82,
|
255 |
+
0x6ef: 82,
|
256 |
+
0x6fa: 68,
|
257 |
+
0x6fb: 68,
|
258 |
+
0x6fc: 68,
|
259 |
+
0x6ff: 68,
|
260 |
+
0x70f: 84,
|
261 |
+
0x710: 82,
|
262 |
+
0x712: 68,
|
263 |
+
0x713: 68,
|
264 |
+
0x714: 68,
|
265 |
+
0x715: 82,
|
266 |
+
0x716: 82,
|
267 |
+
0x717: 82,
|
268 |
+
0x718: 82,
|
269 |
+
0x719: 82,
|
270 |
+
0x71a: 68,
|
271 |
+
0x71b: 68,
|
272 |
+
0x71c: 68,
|
273 |
+
0x71d: 68,
|
274 |
+
0x71e: 82,
|
275 |
+
0x71f: 68,
|
276 |
+
0x720: 68,
|
277 |
+
0x721: 68,
|
278 |
+
0x722: 68,
|
279 |
+
0x723: 68,
|
280 |
+
0x724: 68,
|
281 |
+
0x725: 68,
|
282 |
+
0x726: 68,
|
283 |
+
0x727: 68,
|
284 |
+
0x728: 82,
|
285 |
+
0x729: 68,
|
286 |
+
0x72a: 82,
|
287 |
+
0x72b: 68,
|
288 |
+
0x72c: 82,
|
289 |
+
0x72d: 68,
|
290 |
+
0x72e: 68,
|
291 |
+
0x72f: 82,
|
292 |
+
0x74d: 82,
|
293 |
+
0x74e: 68,
|
294 |
+
0x74f: 68,
|
295 |
+
0x750: 68,
|
296 |
+
0x751: 68,
|
297 |
+
0x752: 68,
|
298 |
+
0x753: 68,
|
299 |
+
0x754: 68,
|
300 |
+
0x755: 68,
|
301 |
+
0x756: 68,
|
302 |
+
0x757: 68,
|
303 |
+
0x758: 68,
|
304 |
+
0x759: 82,
|
305 |
+
0x75a: 82,
|
306 |
+
0x75b: 82,
|
307 |
+
0x75c: 68,
|
308 |
+
0x75d: 68,
|
309 |
+
0x75e: 68,
|
310 |
+
0x75f: 68,
|
311 |
+
0x760: 68,
|
312 |
+
0x761: 68,
|
313 |
+
0x762: 68,
|
314 |
+
0x763: 68,
|
315 |
+
0x764: 68,
|
316 |
+
0x765: 68,
|
317 |
+
0x766: 68,
|
318 |
+
0x767: 68,
|
319 |
+
0x768: 68,
|
320 |
+
0x769: 68,
|
321 |
+
0x76a: 68,
|
322 |
+
0x76b: 82,
|
323 |
+
0x76c: 82,
|
324 |
+
0x76d: 68,
|
325 |
+
0x76e: 68,
|
326 |
+
0x76f: 68,
|
327 |
+
0x770: 68,
|
328 |
+
0x771: 82,
|
329 |
+
0x772: 68,
|
330 |
+
0x773: 82,
|
331 |
+
0x774: 82,
|
332 |
+
0x775: 68,
|
333 |
+
0x776: 68,
|
334 |
+
0x777: 68,
|
335 |
+
0x778: 82,
|
336 |
+
0x779: 82,
|
337 |
+
0x77a: 68,
|
338 |
+
0x77b: 68,
|
339 |
+
0x77c: 68,
|
340 |
+
0x77d: 68,
|
341 |
+
0x77e: 68,
|
342 |
+
0x77f: 68,
|
343 |
+
0x7ca: 68,
|
344 |
+
0x7cb: 68,
|
345 |
+
0x7cc: 68,
|
346 |
+
0x7cd: 68,
|
347 |
+
0x7ce: 68,
|
348 |
+
0x7cf: 68,
|
349 |
+
0x7d0: 68,
|
350 |
+
0x7d1: 68,
|
351 |
+
0x7d2: 68,
|
352 |
+
0x7d3: 68,
|
353 |
+
0x7d4: 68,
|
354 |
+
0x7d5: 68,
|
355 |
+
0x7d6: 68,
|
356 |
+
0x7d7: 68,
|
357 |
+
0x7d8: 68,
|
358 |
+
0x7d9: 68,
|
359 |
+
0x7da: 68,
|
360 |
+
0x7db: 68,
|
361 |
+
0x7dc: 68,
|
362 |
+
0x7dd: 68,
|
363 |
+
0x7de: 68,
|
364 |
+
0x7df: 68,
|
365 |
+
0x7e0: 68,
|
366 |
+
0x7e1: 68,
|
367 |
+
0x7e2: 68,
|
368 |
+
0x7e3: 68,
|
369 |
+
0x7e4: 68,
|
370 |
+
0x7e5: 68,
|
371 |
+
0x7e6: 68,
|
372 |
+
0x7e7: 68,
|
373 |
+
0x7e8: 68,
|
374 |
+
0x7e9: 68,
|
375 |
+
0x7ea: 68,
|
376 |
+
0x7fa: 67,
|
377 |
+
0x840: 82,
|
378 |
+
0x841: 68,
|
379 |
+
0x842: 68,
|
380 |
+
0x843: 68,
|
381 |
+
0x844: 68,
|
382 |
+
0x845: 68,
|
383 |
+
0x846: 82,
|
384 |
+
0x847: 82,
|
385 |
+
0x848: 68,
|
386 |
+
0x849: 82,
|
387 |
+
0x84a: 68,
|
388 |
+
0x84b: 68,
|
389 |
+
0x84c: 68,
|
390 |
+
0x84d: 68,
|
391 |
+
0x84e: 68,
|
392 |
+
0x84f: 68,
|
393 |
+
0x850: 68,
|
394 |
+
0x851: 68,
|
395 |
+
0x852: 68,
|
396 |
+
0x853: 68,
|
397 |
+
0x854: 82,
|
398 |
+
0x855: 68,
|
399 |
+
0x856: 82,
|
400 |
+
0x857: 82,
|
401 |
+
0x858: 82,
|
402 |
+
0x860: 68,
|
403 |
+
0x861: 85,
|
404 |
+
0x862: 68,
|
405 |
+
0x863: 68,
|
406 |
+
0x864: 68,
|
407 |
+
0x865: 68,
|
408 |
+
0x866: 85,
|
409 |
+
0x867: 82,
|
410 |
+
0x868: 68,
|
411 |
+
0x869: 82,
|
412 |
+
0x86a: 82,
|
413 |
+
0x870: 82,
|
414 |
+
0x871: 82,
|
415 |
+
0x872: 82,
|
416 |
+
0x873: 82,
|
417 |
+
0x874: 82,
|
418 |
+
0x875: 82,
|
419 |
+
0x876: 82,
|
420 |
+
0x877: 82,
|
421 |
+
0x878: 82,
|
422 |
+
0x879: 82,
|
423 |
+
0x87a: 82,
|
424 |
+
0x87b: 82,
|
425 |
+
0x87c: 82,
|
426 |
+
0x87d: 82,
|
427 |
+
0x87e: 82,
|
428 |
+
0x87f: 82,
|
429 |
+
0x880: 82,
|
430 |
+
0x881: 82,
|
431 |
+
0x882: 82,
|
432 |
+
0x883: 67,
|
433 |
+
0x884: 67,
|
434 |
+
0x885: 67,
|
435 |
+
0x886: 68,
|
436 |
+
0x887: 85,
|
437 |
+
0x888: 85,
|
438 |
+
0x889: 68,
|
439 |
+
0x88a: 68,
|
440 |
+
0x88b: 68,
|
441 |
+
0x88c: 68,
|
442 |
+
0x88d: 68,
|
443 |
+
0x88e: 82,
|
444 |
+
0x890: 85,
|
445 |
+
0x891: 85,
|
446 |
+
0x8a0: 68,
|
447 |
+
0x8a1: 68,
|
448 |
+
0x8a2: 68,
|
449 |
+
0x8a3: 68,
|
450 |
+
0x8a4: 68,
|
451 |
+
0x8a5: 68,
|
452 |
+
0x8a6: 68,
|
453 |
+
0x8a7: 68,
|
454 |
+
0x8a8: 68,
|
455 |
+
0x8a9: 68,
|
456 |
+
0x8aa: 82,
|
457 |
+
0x8ab: 82,
|
458 |
+
0x8ac: 82,
|
459 |
+
0x8ad: 85,
|
460 |
+
0x8ae: 82,
|
461 |
+
0x8af: 68,
|
462 |
+
0x8b0: 68,
|
463 |
+
0x8b1: 82,
|
464 |
+
0x8b2: 82,
|
465 |
+
0x8b3: 68,
|
466 |
+
0x8b4: 68,
|
467 |
+
0x8b5: 68,
|
468 |
+
0x8b6: 68,
|
469 |
+
0x8b7: 68,
|
470 |
+
0x8b8: 68,
|
471 |
+
0x8b9: 82,
|
472 |
+
0x8ba: 68,
|
473 |
+
0x8bb: 68,
|
474 |
+
0x8bc: 68,
|
475 |
+
0x8bd: 68,
|
476 |
+
0x8be: 68,
|
477 |
+
0x8bf: 68,
|
478 |
+
0x8c0: 68,
|
479 |
+
0x8c1: 68,
|
480 |
+
0x8c2: 68,
|
481 |
+
0x8c3: 68,
|
482 |
+
0x8c4: 68,
|
483 |
+
0x8c5: 68,
|
484 |
+
0x8c6: 68,
|
485 |
+
0x8c7: 68,
|
486 |
+
0x8c8: 68,
|
487 |
+
0x8e2: 85,
|
488 |
+
0x1806: 85,
|
489 |
+
0x1807: 68,
|
490 |
+
0x180a: 67,
|
491 |
+
0x180e: 85,
|
492 |
+
0x1820: 68,
|
493 |
+
0x1821: 68,
|
494 |
+
0x1822: 68,
|
495 |
+
0x1823: 68,
|
496 |
+
0x1824: 68,
|
497 |
+
0x1825: 68,
|
498 |
+
0x1826: 68,
|
499 |
+
0x1827: 68,
|
500 |
+
0x1828: 68,
|
501 |
+
0x1829: 68,
|
502 |
+
0x182a: 68,
|
503 |
+
0x182b: 68,
|
504 |
+
0x182c: 68,
|
505 |
+
0x182d: 68,
|
506 |
+
0x182e: 68,
|
507 |
+
0x182f: 68,
|
508 |
+
0x1830: 68,
|
509 |
+
0x1831: 68,
|
510 |
+
0x1832: 68,
|
511 |
+
0x1833: 68,
|
512 |
+
0x1834: 68,
|
513 |
+
0x1835: 68,
|
514 |
+
0x1836: 68,
|
515 |
+
0x1837: 68,
|
516 |
+
0x1838: 68,
|
517 |
+
0x1839: 68,
|
518 |
+
0x183a: 68,
|
519 |
+
0x183b: 68,
|
520 |
+
0x183c: 68,
|
521 |
+
0x183d: 68,
|
522 |
+
0x183e: 68,
|
523 |
+
0x183f: 68,
|
524 |
+
0x1840: 68,
|
525 |
+
0x1841: 68,
|
526 |
+
0x1842: 68,
|
527 |
+
0x1843: 68,
|
528 |
+
0x1844: 68,
|
529 |
+
0x1845: 68,
|
530 |
+
0x1846: 68,
|
531 |
+
0x1847: 68,
|
532 |
+
0x1848: 68,
|
533 |
+
0x1849: 68,
|
534 |
+
0x184a: 68,
|
535 |
+
0x184b: 68,
|
536 |
+
0x184c: 68,
|
537 |
+
0x184d: 68,
|
538 |
+
0x184e: 68,
|
539 |
+
0x184f: 68,
|
540 |
+
0x1850: 68,
|
541 |
+
0x1851: 68,
|
542 |
+
0x1852: 68,
|
543 |
+
0x1853: 68,
|
544 |
+
0x1854: 68,
|
545 |
+
0x1855: 68,
|
546 |
+
0x1856: 68,
|
547 |
+
0x1857: 68,
|
548 |
+
0x1858: 68,
|
549 |
+
0x1859: 68,
|
550 |
+
0x185a: 68,
|
551 |
+
0x185b: 68,
|
552 |
+
0x185c: 68,
|
553 |
+
0x185d: 68,
|
554 |
+
0x185e: 68,
|
555 |
+
0x185f: 68,
|
556 |
+
0x1860: 68,
|
557 |
+
0x1861: 68,
|
558 |
+
0x1862: 68,
|
559 |
+
0x1863: 68,
|
560 |
+
0x1864: 68,
|
561 |
+
0x1865: 68,
|
562 |
+
0x1866: 68,
|
563 |
+
0x1867: 68,
|
564 |
+
0x1868: 68,
|
565 |
+
0x1869: 68,
|
566 |
+
0x186a: 68,
|
567 |
+
0x186b: 68,
|
568 |
+
0x186c: 68,
|
569 |
+
0x186d: 68,
|
570 |
+
0x186e: 68,
|
571 |
+
0x186f: 68,
|
572 |
+
0x1870: 68,
|
573 |
+
0x1871: 68,
|
574 |
+
0x1872: 68,
|
575 |
+
0x1873: 68,
|
576 |
+
0x1874: 68,
|
577 |
+
0x1875: 68,
|
578 |
+
0x1876: 68,
|
579 |
+
0x1877: 68,
|
580 |
+
0x1878: 68,
|
581 |
+
0x1880: 85,
|
582 |
+
0x1881: 85,
|
583 |
+
0x1882: 85,
|
584 |
+
0x1883: 85,
|
585 |
+
0x1884: 85,
|
586 |
+
0x1885: 84,
|
587 |
+
0x1886: 84,
|
588 |
+
0x1887: 68,
|
589 |
+
0x1888: 68,
|
590 |
+
0x1889: 68,
|
591 |
+
0x188a: 68,
|
592 |
+
0x188b: 68,
|
593 |
+
0x188c: 68,
|
594 |
+
0x188d: 68,
|
595 |
+
0x188e: 68,
|
596 |
+
0x188f: 68,
|
597 |
+
0x1890: 68,
|
598 |
+
0x1891: 68,
|
599 |
+
0x1892: 68,
|
600 |
+
0x1893: 68,
|
601 |
+
0x1894: 68,
|
602 |
+
0x1895: 68,
|
603 |
+
0x1896: 68,
|
604 |
+
0x1897: 68,
|
605 |
+
0x1898: 68,
|
606 |
+
0x1899: 68,
|
607 |
+
0x189a: 68,
|
608 |
+
0x189b: 68,
|
609 |
+
0x189c: 68,
|
610 |
+
0x189d: 68,
|
611 |
+
0x189e: 68,
|
612 |
+
0x189f: 68,
|
613 |
+
0x18a0: 68,
|
614 |
+
0x18a1: 68,
|
615 |
+
0x18a2: 68,
|
616 |
+
0x18a3: 68,
|
617 |
+
0x18a4: 68,
|
618 |
+
0x18a5: 68,
|
619 |
+
0x18a6: 68,
|
620 |
+
0x18a7: 68,
|
621 |
+
0x18a8: 68,
|
622 |
+
0x18aa: 68,
|
623 |
+
0x200c: 85,
|
624 |
+
0x200d: 67,
|
625 |
+
0x202f: 85,
|
626 |
+
0x2066: 85,
|
627 |
+
0x2067: 85,
|
628 |
+
0x2068: 85,
|
629 |
+
0x2069: 85,
|
630 |
+
0xa840: 68,
|
631 |
+
0xa841: 68,
|
632 |
+
0xa842: 68,
|
633 |
+
0xa843: 68,
|
634 |
+
0xa844: 68,
|
635 |
+
0xa845: 68,
|
636 |
+
0xa846: 68,
|
637 |
+
0xa847: 68,
|
638 |
+
0xa848: 68,
|
639 |
+
0xa849: 68,
|
640 |
+
0xa84a: 68,
|
641 |
+
0xa84b: 68,
|
642 |
+
0xa84c: 68,
|
643 |
+
0xa84d: 68,
|
644 |
+
0xa84e: 68,
|
645 |
+
0xa84f: 68,
|
646 |
+
0xa850: 68,
|
647 |
+
0xa851: 68,
|
648 |
+
0xa852: 68,
|
649 |
+
0xa853: 68,
|
650 |
+
0xa854: 68,
|
651 |
+
0xa855: 68,
|
652 |
+
0xa856: 68,
|
653 |
+
0xa857: 68,
|
654 |
+
0xa858: 68,
|
655 |
+
0xa859: 68,
|
656 |
+
0xa85a: 68,
|
657 |
+
0xa85b: 68,
|
658 |
+
0xa85c: 68,
|
659 |
+
0xa85d: 68,
|
660 |
+
0xa85e: 68,
|
661 |
+
0xa85f: 68,
|
662 |
+
0xa860: 68,
|
663 |
+
0xa861: 68,
|
664 |
+
0xa862: 68,
|
665 |
+
0xa863: 68,
|
666 |
+
0xa864: 68,
|
667 |
+
0xa865: 68,
|
668 |
+
0xa866: 68,
|
669 |
+
0xa867: 68,
|
670 |
+
0xa868: 68,
|
671 |
+
0xa869: 68,
|
672 |
+
0xa86a: 68,
|
673 |
+
0xa86b: 68,
|
674 |
+
0xa86c: 68,
|
675 |
+
0xa86d: 68,
|
676 |
+
0xa86e: 68,
|
677 |
+
0xa86f: 68,
|
678 |
+
0xa870: 68,
|
679 |
+
0xa871: 68,
|
680 |
+
0xa872: 76,
|
681 |
+
0xa873: 85,
|
682 |
+
0x10ac0: 68,
|
683 |
+
0x10ac1: 68,
|
684 |
+
0x10ac2: 68,
|
685 |
+
0x10ac3: 68,
|
686 |
+
0x10ac4: 68,
|
687 |
+
0x10ac5: 82,
|
688 |
+
0x10ac6: 85,
|
689 |
+
0x10ac7: 82,
|
690 |
+
0x10ac8: 85,
|
691 |
+
0x10ac9: 82,
|
692 |
+
0x10aca: 82,
|
693 |
+
0x10acb: 85,
|
694 |
+
0x10acc: 85,
|
695 |
+
0x10acd: 76,
|
696 |
+
0x10ace: 82,
|
697 |
+
0x10acf: 82,
|
698 |
+
0x10ad0: 82,
|
699 |
+
0x10ad1: 82,
|
700 |
+
0x10ad2: 82,
|
701 |
+
0x10ad3: 68,
|
702 |
+
0x10ad4: 68,
|
703 |
+
0x10ad5: 68,
|
704 |
+
0x10ad6: 68,
|
705 |
+
0x10ad7: 76,
|
706 |
+
0x10ad8: 68,
|
707 |
+
0x10ad9: 68,
|
708 |
+
0x10ada: 68,
|
709 |
+
0x10adb: 68,
|
710 |
+
0x10adc: 68,
|
711 |
+
0x10add: 82,
|
712 |
+
0x10ade: 68,
|
713 |
+
0x10adf: 68,
|
714 |
+
0x10ae0: 68,
|
715 |
+
0x10ae1: 82,
|
716 |
+
0x10ae2: 85,
|
717 |
+
0x10ae3: 85,
|
718 |
+
0x10ae4: 82,
|
719 |
+
0x10aeb: 68,
|
720 |
+
0x10aec: 68,
|
721 |
+
0x10aed: 68,
|
722 |
+
0x10aee: 68,
|
723 |
+
0x10aef: 82,
|
724 |
+
0x10b80: 68,
|
725 |
+
0x10b81: 82,
|
726 |
+
0x10b82: 68,
|
727 |
+
0x10b83: 82,
|
728 |
+
0x10b84: 82,
|
729 |
+
0x10b85: 82,
|
730 |
+
0x10b86: 68,
|
731 |
+
0x10b87: 68,
|
732 |
+
0x10b88: 68,
|
733 |
+
0x10b89: 82,
|
734 |
+
0x10b8a: 68,
|
735 |
+
0x10b8b: 68,
|
736 |
+
0x10b8c: 82,
|
737 |
+
0x10b8d: 68,
|
738 |
+
0x10b8e: 82,
|
739 |
+
0x10b8f: 82,
|
740 |
+
0x10b90: 68,
|
741 |
+
0x10b91: 82,
|
742 |
+
0x10ba9: 82,
|
743 |
+
0x10baa: 82,
|
744 |
+
0x10bab: 82,
|
745 |
+
0x10bac: 82,
|
746 |
+
0x10bad: 68,
|
747 |
+
0x10bae: 68,
|
748 |
+
0x10baf: 85,
|
749 |
+
0x10d00: 76,
|
750 |
+
0x10d01: 68,
|
751 |
+
0x10d02: 68,
|
752 |
+
0x10d03: 68,
|
753 |
+
0x10d04: 68,
|
754 |
+
0x10d05: 68,
|
755 |
+
0x10d06: 68,
|
756 |
+
0x10d07: 68,
|
757 |
+
0x10d08: 68,
|
758 |
+
0x10d09: 68,
|
759 |
+
0x10d0a: 68,
|
760 |
+
0x10d0b: 68,
|
761 |
+
0x10d0c: 68,
|
762 |
+
0x10d0d: 68,
|
763 |
+
0x10d0e: 68,
|
764 |
+
0x10d0f: 68,
|
765 |
+
0x10d10: 68,
|
766 |
+
0x10d11: 68,
|
767 |
+
0x10d12: 68,
|
768 |
+
0x10d13: 68,
|
769 |
+
0x10d14: 68,
|
770 |
+
0x10d15: 68,
|
771 |
+
0x10d16: 68,
|
772 |
+
0x10d17: 68,
|
773 |
+
0x10d18: 68,
|
774 |
+
0x10d19: 68,
|
775 |
+
0x10d1a: 68,
|
776 |
+
0x10d1b: 68,
|
777 |
+
0x10d1c: 68,
|
778 |
+
0x10d1d: 68,
|
779 |
+
0x10d1e: 68,
|
780 |
+
0x10d1f: 68,
|
781 |
+
0x10d20: 68,
|
782 |
+
0x10d21: 68,
|
783 |
+
0x10d22: 82,
|
784 |
+
0x10d23: 68,
|
785 |
+
0x10f30: 68,
|
786 |
+
0x10f31: 68,
|
787 |
+
0x10f32: 68,
|
788 |
+
0x10f33: 82,
|
789 |
+
0x10f34: 68,
|
790 |
+
0x10f35: 68,
|
791 |
+
0x10f36: 68,
|
792 |
+
0x10f37: 68,
|
793 |
+
0x10f38: 68,
|
794 |
+
0x10f39: 68,
|
795 |
+
0x10f3a: 68,
|
796 |
+
0x10f3b: 68,
|
797 |
+
0x10f3c: 68,
|
798 |
+
0x10f3d: 68,
|
799 |
+
0x10f3e: 68,
|
800 |
+
0x10f3f: 68,
|
801 |
+
0x10f40: 68,
|
802 |
+
0x10f41: 68,
|
803 |
+
0x10f42: 68,
|
804 |
+
0x10f43: 68,
|
805 |
+
0x10f44: 68,
|
806 |
+
0x10f45: 85,
|
807 |
+
0x10f51: 68,
|
808 |
+
0x10f52: 68,
|
809 |
+
0x10f53: 68,
|
810 |
+
0x10f54: 82,
|
811 |
+
0x10f70: 68,
|
812 |
+
0x10f71: 68,
|
813 |
+
0x10f72: 68,
|
814 |
+
0x10f73: 68,
|
815 |
+
0x10f74: 82,
|
816 |
+
0x10f75: 82,
|
817 |
+
0x10f76: 68,
|
818 |
+
0x10f77: 68,
|
819 |
+
0x10f78: 68,
|
820 |
+
0x10f79: 68,
|
821 |
+
0x10f7a: 68,
|
822 |
+
0x10f7b: 68,
|
823 |
+
0x10f7c: 68,
|
824 |
+
0x10f7d: 68,
|
825 |
+
0x10f7e: 68,
|
826 |
+
0x10f7f: 68,
|
827 |
+
0x10f80: 68,
|
828 |
+
0x10f81: 68,
|
829 |
+
0x10fb0: 68,
|
830 |
+
0x10fb1: 85,
|
831 |
+
0x10fb2: 68,
|
832 |
+
0x10fb3: 68,
|
833 |
+
0x10fb4: 82,
|
834 |
+
0x10fb5: 82,
|
835 |
+
0x10fb6: 82,
|
836 |
+
0x10fb7: 85,
|
837 |
+
0x10fb8: 68,
|
838 |
+
0x10fb9: 82,
|
839 |
+
0x10fba: 82,
|
840 |
+
0x10fbb: 68,
|
841 |
+
0x10fbc: 68,
|
842 |
+
0x10fbd: 82,
|
843 |
+
0x10fbe: 68,
|
844 |
+
0x10fbf: 68,
|
845 |
+
0x10fc0: 85,
|
846 |
+
0x10fc1: 68,
|
847 |
+
0x10fc2: 82,
|
848 |
+
0x10fc3: 82,
|
849 |
+
0x10fc4: 68,
|
850 |
+
0x10fc5: 85,
|
851 |
+
0x10fc6: 85,
|
852 |
+
0x10fc7: 85,
|
853 |
+
0x10fc8: 85,
|
854 |
+
0x10fc9: 82,
|
855 |
+
0x10fca: 68,
|
856 |
+
0x10fcb: 76,
|
857 |
+
0x110bd: 85,
|
858 |
+
0x110cd: 85,
|
859 |
+
0x1e900: 68,
|
860 |
+
0x1e901: 68,
|
861 |
+
0x1e902: 68,
|
862 |
+
0x1e903: 68,
|
863 |
+
0x1e904: 68,
|
864 |
+
0x1e905: 68,
|
865 |
+
0x1e906: 68,
|
866 |
+
0x1e907: 68,
|
867 |
+
0x1e908: 68,
|
868 |
+
0x1e909: 68,
|
869 |
+
0x1e90a: 68,
|
870 |
+
0x1e90b: 68,
|
871 |
+
0x1e90c: 68,
|
872 |
+
0x1e90d: 68,
|
873 |
+
0x1e90e: 68,
|
874 |
+
0x1e90f: 68,
|
875 |
+
0x1e910: 68,
|
876 |
+
0x1e911: 68,
|
877 |
+
0x1e912: 68,
|
878 |
+
0x1e913: 68,
|
879 |
+
0x1e914: 68,
|
880 |
+
0x1e915: 68,
|
881 |
+
0x1e916: 68,
|
882 |
+
0x1e917: 68,
|
883 |
+
0x1e918: 68,
|
884 |
+
0x1e919: 68,
|
885 |
+
0x1e91a: 68,
|
886 |
+
0x1e91b: 68,
|
887 |
+
0x1e91c: 68,
|
888 |
+
0x1e91d: 68,
|
889 |
+
0x1e91e: 68,
|
890 |
+
0x1e91f: 68,
|
891 |
+
0x1e920: 68,
|
892 |
+
0x1e921: 68,
|
893 |
+
0x1e922: 68,
|
894 |
+
0x1e923: 68,
|
895 |
+
0x1e924: 68,
|
896 |
+
0x1e925: 68,
|
897 |
+
0x1e926: 68,
|
898 |
+
0x1e927: 68,
|
899 |
+
0x1e928: 68,
|
900 |
+
0x1e929: 68,
|
901 |
+
0x1e92a: 68,
|
902 |
+
0x1e92b: 68,
|
903 |
+
0x1e92c: 68,
|
904 |
+
0x1e92d: 68,
|
905 |
+
0x1e92e: 68,
|
906 |
+
0x1e92f: 68,
|
907 |
+
0x1e930: 68,
|
908 |
+
0x1e931: 68,
|
909 |
+
0x1e932: 68,
|
910 |
+
0x1e933: 68,
|
911 |
+
0x1e934: 68,
|
912 |
+
0x1e935: 68,
|
913 |
+
0x1e936: 68,
|
914 |
+
0x1e937: 68,
|
915 |
+
0x1e938: 68,
|
916 |
+
0x1e939: 68,
|
917 |
+
0x1e93a: 68,
|
918 |
+
0x1e93b: 68,
|
919 |
+
0x1e93c: 68,
|
920 |
+
0x1e93d: 68,
|
921 |
+
0x1e93e: 68,
|
922 |
+
0x1e93f: 68,
|
923 |
+
0x1e940: 68,
|
924 |
+
0x1e941: 68,
|
925 |
+
0x1e942: 68,
|
926 |
+
0x1e943: 68,
|
927 |
+
0x1e94b: 84,
|
928 |
+
}
|
929 |
+
codepoint_classes = {
|
930 |
+
'PVALID': (
|
931 |
+
0x2d0000002e,
|
932 |
+
0x300000003a,
|
933 |
+
0x610000007b,
|
934 |
+
0xdf000000f7,
|
935 |
+
0xf800000100,
|
936 |
+
0x10100000102,
|
937 |
+
0x10300000104,
|
938 |
+
0x10500000106,
|
939 |
+
0x10700000108,
|
940 |
+
0x1090000010a,
|
941 |
+
0x10b0000010c,
|
942 |
+
0x10d0000010e,
|
943 |
+
0x10f00000110,
|
944 |
+
0x11100000112,
|
945 |
+
0x11300000114,
|
946 |
+
0x11500000116,
|
947 |
+
0x11700000118,
|
948 |
+
0x1190000011a,
|
949 |
+
0x11b0000011c,
|
950 |
+
0x11d0000011e,
|
951 |
+
0x11f00000120,
|
952 |
+
0x12100000122,
|
953 |
+
0x12300000124,
|
954 |
+
0x12500000126,
|
955 |
+
0x12700000128,
|
956 |
+
0x1290000012a,
|
957 |
+
0x12b0000012c,
|
958 |
+
0x12d0000012e,
|
959 |
+
0x12f00000130,
|
960 |
+
0x13100000132,
|
961 |
+
0x13500000136,
|
962 |
+
0x13700000139,
|
963 |
+
0x13a0000013b,
|
964 |
+
0x13c0000013d,
|
965 |
+
0x13e0000013f,
|
966 |
+
0x14200000143,
|
967 |
+
0x14400000145,
|
968 |
+
0x14600000147,
|
969 |
+
0x14800000149,
|
970 |
+
0x14b0000014c,
|
971 |
+
0x14d0000014e,
|
972 |
+
0x14f00000150,
|
973 |
+
0x15100000152,
|
974 |
+
0x15300000154,
|
975 |
+
0x15500000156,
|
976 |
+
0x15700000158,
|
977 |
+
0x1590000015a,
|
978 |
+
0x15b0000015c,
|
979 |
+
0x15d0000015e,
|
980 |
+
0x15f00000160,
|
981 |
+
0x16100000162,
|
982 |
+
0x16300000164,
|
983 |
+
0x16500000166,
|
984 |
+
0x16700000168,
|
985 |
+
0x1690000016a,
|
986 |
+
0x16b0000016c,
|
987 |
+
0x16d0000016e,
|
988 |
+
0x16f00000170,
|
989 |
+
0x17100000172,
|
990 |
+
0x17300000174,
|
991 |
+
0x17500000176,
|
992 |
+
0x17700000178,
|
993 |
+
0x17a0000017b,
|
994 |
+
0x17c0000017d,
|
995 |
+
0x17e0000017f,
|
996 |
+
0x18000000181,
|
997 |
+
0x18300000184,
|
998 |
+
0x18500000186,
|
999 |
+
0x18800000189,
|
1000 |
+
0x18c0000018e,
|
1001 |
+
0x19200000193,
|
1002 |
+
0x19500000196,
|
1003 |
+
0x1990000019c,
|
1004 |
+
0x19e0000019f,
|
1005 |
+
0x1a1000001a2,
|
1006 |
+
0x1a3000001a4,
|
1007 |
+
0x1a5000001a6,
|
1008 |
+
0x1a8000001a9,
|
1009 |
+
0x1aa000001ac,
|
1010 |
+
0x1ad000001ae,
|
1011 |
+
0x1b0000001b1,
|
1012 |
+
0x1b4000001b5,
|
1013 |
+
0x1b6000001b7,
|
1014 |
+
0x1b9000001bc,
|
1015 |
+
0x1bd000001c4,
|
1016 |
+
0x1ce000001cf,
|
1017 |
+
0x1d0000001d1,
|
1018 |
+
0x1d2000001d3,
|
1019 |
+
0x1d4000001d5,
|
1020 |
+
0x1d6000001d7,
|
1021 |
+
0x1d8000001d9,
|
1022 |
+
0x1da000001db,
|
1023 |
+
0x1dc000001de,
|
1024 |
+
0x1df000001e0,
|
1025 |
+
0x1e1000001e2,
|
1026 |
+
0x1e3000001e4,
|
1027 |
+
0x1e5000001e6,
|
1028 |
+
0x1e7000001e8,
|
1029 |
+
0x1e9000001ea,
|
1030 |
+
0x1eb000001ec,
|
1031 |
+
0x1ed000001ee,
|
1032 |
+
0x1ef000001f1,
|
1033 |
+
0x1f5000001f6,
|
1034 |
+
0x1f9000001fa,
|
1035 |
+
0x1fb000001fc,
|
1036 |
+
0x1fd000001fe,
|
1037 |
+
0x1ff00000200,
|
1038 |
+
0x20100000202,
|
1039 |
+
0x20300000204,
|
1040 |
+
0x20500000206,
|
1041 |
+
0x20700000208,
|
1042 |
+
0x2090000020a,
|
1043 |
+
0x20b0000020c,
|
1044 |
+
0x20d0000020e,
|
1045 |
+
0x20f00000210,
|
1046 |
+
0x21100000212,
|
1047 |
+
0x21300000214,
|
1048 |
+
0x21500000216,
|
1049 |
+
0x21700000218,
|
1050 |
+
0x2190000021a,
|
1051 |
+
0x21b0000021c,
|
1052 |
+
0x21d0000021e,
|
1053 |
+
0x21f00000220,
|
1054 |
+
0x22100000222,
|
1055 |
+
0x22300000224,
|
1056 |
+
0x22500000226,
|
1057 |
+
0x22700000228,
|
1058 |
+
0x2290000022a,
|
1059 |
+
0x22b0000022c,
|
1060 |
+
0x22d0000022e,
|
1061 |
+
0x22f00000230,
|
1062 |
+
0x23100000232,
|
1063 |
+
0x2330000023a,
|
1064 |
+
0x23c0000023d,
|
1065 |
+
0x23f00000241,
|
1066 |
+
0x24200000243,
|
1067 |
+
0x24700000248,
|
1068 |
+
0x2490000024a,
|
1069 |
+
0x24b0000024c,
|
1070 |
+
0x24d0000024e,
|
1071 |
+
0x24f000002b0,
|
1072 |
+
0x2b9000002c2,
|
1073 |
+
0x2c6000002d2,
|
1074 |
+
0x2ec000002ed,
|
1075 |
+
0x2ee000002ef,
|
1076 |
+
0x30000000340,
|
1077 |
+
0x34200000343,
|
1078 |
+
0x3460000034f,
|
1079 |
+
0x35000000370,
|
1080 |
+
0x37100000372,
|
1081 |
+
0x37300000374,
|
1082 |
+
0x37700000378,
|
1083 |
+
0x37b0000037e,
|
1084 |
+
0x39000000391,
|
1085 |
+
0x3ac000003cf,
|
1086 |
+
0x3d7000003d8,
|
1087 |
+
0x3d9000003da,
|
1088 |
+
0x3db000003dc,
|
1089 |
+
0x3dd000003de,
|
1090 |
+
0x3df000003e0,
|
1091 |
+
0x3e1000003e2,
|
1092 |
+
0x3e3000003e4,
|
1093 |
+
0x3e5000003e6,
|
1094 |
+
0x3e7000003e8,
|
1095 |
+
0x3e9000003ea,
|
1096 |
+
0x3eb000003ec,
|
1097 |
+
0x3ed000003ee,
|
1098 |
+
0x3ef000003f0,
|
1099 |
+
0x3f3000003f4,
|
1100 |
+
0x3f8000003f9,
|
1101 |
+
0x3fb000003fd,
|
1102 |
+
0x43000000460,
|
1103 |
+
0x46100000462,
|
1104 |
+
0x46300000464,
|
1105 |
+
0x46500000466,
|
1106 |
+
0x46700000468,
|
1107 |
+
0x4690000046a,
|
1108 |
+
0x46b0000046c,
|
1109 |
+
0x46d0000046e,
|
1110 |
+
0x46f00000470,
|
1111 |
+
0x47100000472,
|
1112 |
+
0x47300000474,
|
1113 |
+
0x47500000476,
|
1114 |
+
0x47700000478,
|
1115 |
+
0x4790000047a,
|
1116 |
+
0x47b0000047c,
|
1117 |
+
0x47d0000047e,
|
1118 |
+
0x47f00000480,
|
1119 |
+
0x48100000482,
|
1120 |
+
0x48300000488,
|
1121 |
+
0x48b0000048c,
|
1122 |
+
0x48d0000048e,
|
1123 |
+
0x48f00000490,
|
1124 |
+
0x49100000492,
|
1125 |
+
0x49300000494,
|
1126 |
+
0x49500000496,
|
1127 |
+
0x49700000498,
|
1128 |
+
0x4990000049a,
|
1129 |
+
0x49b0000049c,
|
1130 |
+
0x49d0000049e,
|
1131 |
+
0x49f000004a0,
|
1132 |
+
0x4a1000004a2,
|
1133 |
+
0x4a3000004a4,
|
1134 |
+
0x4a5000004a6,
|
1135 |
+
0x4a7000004a8,
|
1136 |
+
0x4a9000004aa,
|
1137 |
+
0x4ab000004ac,
|
1138 |
+
0x4ad000004ae,
|
1139 |
+
0x4af000004b0,
|
1140 |
+
0x4b1000004b2,
|
1141 |
+
0x4b3000004b4,
|
1142 |
+
0x4b5000004b6,
|
1143 |
+
0x4b7000004b8,
|
1144 |
+
0x4b9000004ba,
|
1145 |
+
0x4bb000004bc,
|
1146 |
+
0x4bd000004be,
|
1147 |
+
0x4bf000004c0,
|
1148 |
+
0x4c2000004c3,
|
1149 |
+
0x4c4000004c5,
|
1150 |
+
0x4c6000004c7,
|
1151 |
+
0x4c8000004c9,
|
1152 |
+
0x4ca000004cb,
|
1153 |
+
0x4cc000004cd,
|
1154 |
+
0x4ce000004d0,
|
1155 |
+
0x4d1000004d2,
|
1156 |
+
0x4d3000004d4,
|
1157 |
+
0x4d5000004d6,
|
1158 |
+
0x4d7000004d8,
|
1159 |
+
0x4d9000004da,
|
1160 |
+
0x4db000004dc,
|
1161 |
+
0x4dd000004de,
|
1162 |
+
0x4df000004e0,
|
1163 |
+
0x4e1000004e2,
|
1164 |
+
0x4e3000004e4,
|
1165 |
+
0x4e5000004e6,
|
1166 |
+
0x4e7000004e8,
|
1167 |
+
0x4e9000004ea,
|
1168 |
+
0x4eb000004ec,
|
1169 |
+
0x4ed000004ee,
|
1170 |
+
0x4ef000004f0,
|
1171 |
+
0x4f1000004f2,
|
1172 |
+
0x4f3000004f4,
|
1173 |
+
0x4f5000004f6,
|
1174 |
+
0x4f7000004f8,
|
1175 |
+
0x4f9000004fa,
|
1176 |
+
0x4fb000004fc,
|
1177 |
+
0x4fd000004fe,
|
1178 |
+
0x4ff00000500,
|
1179 |
+
0x50100000502,
|
1180 |
+
0x50300000504,
|
1181 |
+
0x50500000506,
|
1182 |
+
0x50700000508,
|
1183 |
+
0x5090000050a,
|
1184 |
+
0x50b0000050c,
|
1185 |
+
0x50d0000050e,
|
1186 |
+
0x50f00000510,
|
1187 |
+
0x51100000512,
|
1188 |
+
0x51300000514,
|
1189 |
+
0x51500000516,
|
1190 |
+
0x51700000518,
|
1191 |
+
0x5190000051a,
|
1192 |
+
0x51b0000051c,
|
1193 |
+
0x51d0000051e,
|
1194 |
+
0x51f00000520,
|
1195 |
+
0x52100000522,
|
1196 |
+
0x52300000524,
|
1197 |
+
0x52500000526,
|
1198 |
+
0x52700000528,
|
1199 |
+
0x5290000052a,
|
1200 |
+
0x52b0000052c,
|
1201 |
+
0x52d0000052e,
|
1202 |
+
0x52f00000530,
|
1203 |
+
0x5590000055a,
|
1204 |
+
0x56000000587,
|
1205 |
+
0x58800000589,
|
1206 |
+
0x591000005be,
|
1207 |
+
0x5bf000005c0,
|
1208 |
+
0x5c1000005c3,
|
1209 |
+
0x5c4000005c6,
|
1210 |
+
0x5c7000005c8,
|
1211 |
+
0x5d0000005eb,
|
1212 |
+
0x5ef000005f3,
|
1213 |
+
0x6100000061b,
|
1214 |
+
0x62000000640,
|
1215 |
+
0x64100000660,
|
1216 |
+
0x66e00000675,
|
1217 |
+
0x679000006d4,
|
1218 |
+
0x6d5000006dd,
|
1219 |
+
0x6df000006e9,
|
1220 |
+
0x6ea000006f0,
|
1221 |
+
0x6fa00000700,
|
1222 |
+
0x7100000074b,
|
1223 |
+
0x74d000007b2,
|
1224 |
+
0x7c0000007f6,
|
1225 |
+
0x7fd000007fe,
|
1226 |
+
0x8000000082e,
|
1227 |
+
0x8400000085c,
|
1228 |
+
0x8600000086b,
|
1229 |
+
0x87000000888,
|
1230 |
+
0x8890000088f,
|
1231 |
+
0x898000008e2,
|
1232 |
+
0x8e300000958,
|
1233 |
+
0x96000000964,
|
1234 |
+
0x96600000970,
|
1235 |
+
0x97100000984,
|
1236 |
+
0x9850000098d,
|
1237 |
+
0x98f00000991,
|
1238 |
+
0x993000009a9,
|
1239 |
+
0x9aa000009b1,
|
1240 |
+
0x9b2000009b3,
|
1241 |
+
0x9b6000009ba,
|
1242 |
+
0x9bc000009c5,
|
1243 |
+
0x9c7000009c9,
|
1244 |
+
0x9cb000009cf,
|
1245 |
+
0x9d7000009d8,
|
1246 |
+
0x9e0000009e4,
|
1247 |
+
0x9e6000009f2,
|
1248 |
+
0x9fc000009fd,
|
1249 |
+
0x9fe000009ff,
|
1250 |
+
0xa0100000a04,
|
1251 |
+
0xa0500000a0b,
|
1252 |
+
0xa0f00000a11,
|
1253 |
+
0xa1300000a29,
|
1254 |
+
0xa2a00000a31,
|
1255 |
+
0xa3200000a33,
|
1256 |
+
0xa3500000a36,
|
1257 |
+
0xa3800000a3a,
|
1258 |
+
0xa3c00000a3d,
|
1259 |
+
0xa3e00000a43,
|
1260 |
+
0xa4700000a49,
|
1261 |
+
0xa4b00000a4e,
|
1262 |
+
0xa5100000a52,
|
1263 |
+
0xa5c00000a5d,
|
1264 |
+
0xa6600000a76,
|
1265 |
+
0xa8100000a84,
|
1266 |
+
0xa8500000a8e,
|
1267 |
+
0xa8f00000a92,
|
1268 |
+
0xa9300000aa9,
|
1269 |
+
0xaaa00000ab1,
|
1270 |
+
0xab200000ab4,
|
1271 |
+
0xab500000aba,
|
1272 |
+
0xabc00000ac6,
|
1273 |
+
0xac700000aca,
|
1274 |
+
0xacb00000ace,
|
1275 |
+
0xad000000ad1,
|
1276 |
+
0xae000000ae4,
|
1277 |
+
0xae600000af0,
|
1278 |
+
0xaf900000b00,
|
1279 |
+
0xb0100000b04,
|
1280 |
+
0xb0500000b0d,
|
1281 |
+
0xb0f00000b11,
|
1282 |
+
0xb1300000b29,
|
1283 |
+
0xb2a00000b31,
|
1284 |
+
0xb3200000b34,
|
1285 |
+
0xb3500000b3a,
|
1286 |
+
0xb3c00000b45,
|
1287 |
+
0xb4700000b49,
|
1288 |
+
0xb4b00000b4e,
|
1289 |
+
0xb5500000b58,
|
1290 |
+
0xb5f00000b64,
|
1291 |
+
0xb6600000b70,
|
1292 |
+
0xb7100000b72,
|
1293 |
+
0xb8200000b84,
|
1294 |
+
0xb8500000b8b,
|
1295 |
+
0xb8e00000b91,
|
1296 |
+
0xb9200000b96,
|
1297 |
+
0xb9900000b9b,
|
1298 |
+
0xb9c00000b9d,
|
1299 |
+
0xb9e00000ba0,
|
1300 |
+
0xba300000ba5,
|
1301 |
+
0xba800000bab,
|
1302 |
+
0xbae00000bba,
|
1303 |
+
0xbbe00000bc3,
|
1304 |
+
0xbc600000bc9,
|
1305 |
+
0xbca00000bce,
|
1306 |
+
0xbd000000bd1,
|
1307 |
+
0xbd700000bd8,
|
1308 |
+
0xbe600000bf0,
|
1309 |
+
0xc0000000c0d,
|
1310 |
+
0xc0e00000c11,
|
1311 |
+
0xc1200000c29,
|
1312 |
+
0xc2a00000c3a,
|
1313 |
+
0xc3c00000c45,
|
1314 |
+
0xc4600000c49,
|
1315 |
+
0xc4a00000c4e,
|
1316 |
+
0xc5500000c57,
|
1317 |
+
0xc5800000c5b,
|
1318 |
+
0xc5d00000c5e,
|
1319 |
+
0xc6000000c64,
|
1320 |
+
0xc6600000c70,
|
1321 |
+
0xc8000000c84,
|
1322 |
+
0xc8500000c8d,
|
1323 |
+
0xc8e00000c91,
|
1324 |
+
0xc9200000ca9,
|
1325 |
+
0xcaa00000cb4,
|
1326 |
+
0xcb500000cba,
|
1327 |
+
0xcbc00000cc5,
|
1328 |
+
0xcc600000cc9,
|
1329 |
+
0xcca00000cce,
|
1330 |
+
0xcd500000cd7,
|
1331 |
+
0xcdd00000cdf,
|
1332 |
+
0xce000000ce4,
|
1333 |
+
0xce600000cf0,
|
1334 |
+
0xcf100000cf3,
|
1335 |
+
0xd0000000d0d,
|
1336 |
+
0xd0e00000d11,
|
1337 |
+
0xd1200000d45,
|
1338 |
+
0xd4600000d49,
|
1339 |
+
0xd4a00000d4f,
|
1340 |
+
0xd5400000d58,
|
1341 |
+
0xd5f00000d64,
|
1342 |
+
0xd6600000d70,
|
1343 |
+
0xd7a00000d80,
|
1344 |
+
0xd8100000d84,
|
1345 |
+
0xd8500000d97,
|
1346 |
+
0xd9a00000db2,
|
1347 |
+
0xdb300000dbc,
|
1348 |
+
0xdbd00000dbe,
|
1349 |
+
0xdc000000dc7,
|
1350 |
+
0xdca00000dcb,
|
1351 |
+
0xdcf00000dd5,
|
1352 |
+
0xdd600000dd7,
|
1353 |
+
0xdd800000de0,
|
1354 |
+
0xde600000df0,
|
1355 |
+
0xdf200000df4,
|
1356 |
+
0xe0100000e33,
|
1357 |
+
0xe3400000e3b,
|
1358 |
+
0xe4000000e4f,
|
1359 |
+
0xe5000000e5a,
|
1360 |
+
0xe8100000e83,
|
1361 |
+
0xe8400000e85,
|
1362 |
+
0xe8600000e8b,
|
1363 |
+
0xe8c00000ea4,
|
1364 |
+
0xea500000ea6,
|
1365 |
+
0xea700000eb3,
|
1366 |
+
0xeb400000ebe,
|
1367 |
+
0xec000000ec5,
|
1368 |
+
0xec600000ec7,
|
1369 |
+
0xec800000ece,
|
1370 |
+
0xed000000eda,
|
1371 |
+
0xede00000ee0,
|
1372 |
+
0xf0000000f01,
|
1373 |
+
0xf0b00000f0c,
|
1374 |
+
0xf1800000f1a,
|
1375 |
+
0xf2000000f2a,
|
1376 |
+
0xf3500000f36,
|
1377 |
+
0xf3700000f38,
|
1378 |
+
0xf3900000f3a,
|
1379 |
+
0xf3e00000f43,
|
1380 |
+
0xf4400000f48,
|
1381 |
+
0xf4900000f4d,
|
1382 |
+
0xf4e00000f52,
|
1383 |
+
0xf5300000f57,
|
1384 |
+
0xf5800000f5c,
|
1385 |
+
0xf5d00000f69,
|
1386 |
+
0xf6a00000f6d,
|
1387 |
+
0xf7100000f73,
|
1388 |
+
0xf7400000f75,
|
1389 |
+
0xf7a00000f81,
|
1390 |
+
0xf8200000f85,
|
1391 |
+
0xf8600000f93,
|
1392 |
+
0xf9400000f98,
|
1393 |
+
0xf9900000f9d,
|
1394 |
+
0xf9e00000fa2,
|
1395 |
+
0xfa300000fa7,
|
1396 |
+
0xfa800000fac,
|
1397 |
+
0xfad00000fb9,
|
1398 |
+
0xfba00000fbd,
|
1399 |
+
0xfc600000fc7,
|
1400 |
+
0x10000000104a,
|
1401 |
+
0x10500000109e,
|
1402 |
+
0x10d0000010fb,
|
1403 |
+
0x10fd00001100,
|
1404 |
+
0x120000001249,
|
1405 |
+
0x124a0000124e,
|
1406 |
+
0x125000001257,
|
1407 |
+
0x125800001259,
|
1408 |
+
0x125a0000125e,
|
1409 |
+
0x126000001289,
|
1410 |
+
0x128a0000128e,
|
1411 |
+
0x1290000012b1,
|
1412 |
+
0x12b2000012b6,
|
1413 |
+
0x12b8000012bf,
|
1414 |
+
0x12c0000012c1,
|
1415 |
+
0x12c2000012c6,
|
1416 |
+
0x12c8000012d7,
|
1417 |
+
0x12d800001311,
|
1418 |
+
0x131200001316,
|
1419 |
+
0x13180000135b,
|
1420 |
+
0x135d00001360,
|
1421 |
+
0x138000001390,
|
1422 |
+
0x13a0000013f6,
|
1423 |
+
0x14010000166d,
|
1424 |
+
0x166f00001680,
|
1425 |
+
0x16810000169b,
|
1426 |
+
0x16a0000016eb,
|
1427 |
+
0x16f1000016f9,
|
1428 |
+
0x170000001716,
|
1429 |
+
0x171f00001735,
|
1430 |
+
0x174000001754,
|
1431 |
+
0x17600000176d,
|
1432 |
+
0x176e00001771,
|
1433 |
+
0x177200001774,
|
1434 |
+
0x1780000017b4,
|
1435 |
+
0x17b6000017d4,
|
1436 |
+
0x17d7000017d8,
|
1437 |
+
0x17dc000017de,
|
1438 |
+
0x17e0000017ea,
|
1439 |
+
0x18100000181a,
|
1440 |
+
0x182000001879,
|
1441 |
+
0x1880000018ab,
|
1442 |
+
0x18b0000018f6,
|
1443 |
+
0x19000000191f,
|
1444 |
+
0x19200000192c,
|
1445 |
+
0x19300000193c,
|
1446 |
+
0x19460000196e,
|
1447 |
+
0x197000001975,
|
1448 |
+
0x1980000019ac,
|
1449 |
+
0x19b0000019ca,
|
1450 |
+
0x19d0000019da,
|
1451 |
+
0x1a0000001a1c,
|
1452 |
+
0x1a2000001a5f,
|
1453 |
+
0x1a6000001a7d,
|
1454 |
+
0x1a7f00001a8a,
|
1455 |
+
0x1a9000001a9a,
|
1456 |
+
0x1aa700001aa8,
|
1457 |
+
0x1ab000001abe,
|
1458 |
+
0x1abf00001acf,
|
1459 |
+
0x1b0000001b4d,
|
1460 |
+
0x1b5000001b5a,
|
1461 |
+
0x1b6b00001b74,
|
1462 |
+
0x1b8000001bf4,
|
1463 |
+
0x1c0000001c38,
|
1464 |
+
0x1c4000001c4a,
|
1465 |
+
0x1c4d00001c7e,
|
1466 |
+
0x1cd000001cd3,
|
1467 |
+
0x1cd400001cfb,
|
1468 |
+
0x1d0000001d2c,
|
1469 |
+
0x1d2f00001d30,
|
1470 |
+
0x1d3b00001d3c,
|
1471 |
+
0x1d4e00001d4f,
|
1472 |
+
0x1d6b00001d78,
|
1473 |
+
0x1d7900001d9b,
|
1474 |
+
0x1dc000001e00,
|
1475 |
+
0x1e0100001e02,
|
1476 |
+
0x1e0300001e04,
|
1477 |
+
0x1e0500001e06,
|
1478 |
+
0x1e0700001e08,
|
1479 |
+
0x1e0900001e0a,
|
1480 |
+
0x1e0b00001e0c,
|
1481 |
+
0x1e0d00001e0e,
|
1482 |
+
0x1e0f00001e10,
|
1483 |
+
0x1e1100001e12,
|
1484 |
+
0x1e1300001e14,
|
1485 |
+
0x1e1500001e16,
|
1486 |
+
0x1e1700001e18,
|
1487 |
+
0x1e1900001e1a,
|
1488 |
+
0x1e1b00001e1c,
|
1489 |
+
0x1e1d00001e1e,
|
1490 |
+
0x1e1f00001e20,
|
1491 |
+
0x1e2100001e22,
|
1492 |
+
0x1e2300001e24,
|
1493 |
+
0x1e2500001e26,
|
1494 |
+
0x1e2700001e28,
|
1495 |
+
0x1e2900001e2a,
|
1496 |
+
0x1e2b00001e2c,
|
1497 |
+
0x1e2d00001e2e,
|
1498 |
+
0x1e2f00001e30,
|
1499 |
+
0x1e3100001e32,
|
1500 |
+
0x1e3300001e34,
|
1501 |
+
0x1e3500001e36,
|
1502 |
+
0x1e3700001e38,
|
1503 |
+
0x1e3900001e3a,
|
1504 |
+
0x1e3b00001e3c,
|
1505 |
+
0x1e3d00001e3e,
|
1506 |
+
0x1e3f00001e40,
|
1507 |
+
0x1e4100001e42,
|
1508 |
+
0x1e4300001e44,
|
1509 |
+
0x1e4500001e46,
|
1510 |
+
0x1e4700001e48,
|
1511 |
+
0x1e4900001e4a,
|
1512 |
+
0x1e4b00001e4c,
|
1513 |
+
0x1e4d00001e4e,
|
1514 |
+
0x1e4f00001e50,
|
1515 |
+
0x1e5100001e52,
|
1516 |
+
0x1e5300001e54,
|
1517 |
+
0x1e5500001e56,
|
1518 |
+
0x1e5700001e58,
|
1519 |
+
0x1e5900001e5a,
|
1520 |
+
0x1e5b00001e5c,
|
1521 |
+
0x1e5d00001e5e,
|
1522 |
+
0x1e5f00001e60,
|
1523 |
+
0x1e6100001e62,
|
1524 |
+
0x1e6300001e64,
|
1525 |
+
0x1e6500001e66,
|
1526 |
+
0x1e6700001e68,
|
1527 |
+
0x1e6900001e6a,
|
1528 |
+
0x1e6b00001e6c,
|
1529 |
+
0x1e6d00001e6e,
|
1530 |
+
0x1e6f00001e70,
|
1531 |
+
0x1e7100001e72,
|
1532 |
+
0x1e7300001e74,
|
1533 |
+
0x1e7500001e76,
|
1534 |
+
0x1e7700001e78,
|
1535 |
+
0x1e7900001e7a,
|
1536 |
+
0x1e7b00001e7c,
|
1537 |
+
0x1e7d00001e7e,
|
1538 |
+
0x1e7f00001e80,
|
1539 |
+
0x1e8100001e82,
|
1540 |
+
0x1e8300001e84,
|
1541 |
+
0x1e8500001e86,
|
1542 |
+
0x1e8700001e88,
|
1543 |
+
0x1e8900001e8a,
|
1544 |
+
0x1e8b00001e8c,
|
1545 |
+
0x1e8d00001e8e,
|
1546 |
+
0x1e8f00001e90,
|
1547 |
+
0x1e9100001e92,
|
1548 |
+
0x1e9300001e94,
|
1549 |
+
0x1e9500001e9a,
|
1550 |
+
0x1e9c00001e9e,
|
1551 |
+
0x1e9f00001ea0,
|
1552 |
+
0x1ea100001ea2,
|
1553 |
+
0x1ea300001ea4,
|
1554 |
+
0x1ea500001ea6,
|
1555 |
+
0x1ea700001ea8,
|
1556 |
+
0x1ea900001eaa,
|
1557 |
+
0x1eab00001eac,
|
1558 |
+
0x1ead00001eae,
|
1559 |
+
0x1eaf00001eb0,
|
1560 |
+
0x1eb100001eb2,
|
1561 |
+
0x1eb300001eb4,
|
1562 |
+
0x1eb500001eb6,
|
1563 |
+
0x1eb700001eb8,
|
1564 |
+
0x1eb900001eba,
|
1565 |
+
0x1ebb00001ebc,
|
1566 |
+
0x1ebd00001ebe,
|
1567 |
+
0x1ebf00001ec0,
|
1568 |
+
0x1ec100001ec2,
|
1569 |
+
0x1ec300001ec4,
|
1570 |
+
0x1ec500001ec6,
|
1571 |
+
0x1ec700001ec8,
|
1572 |
+
0x1ec900001eca,
|
1573 |
+
0x1ecb00001ecc,
|
1574 |
+
0x1ecd00001ece,
|
1575 |
+
0x1ecf00001ed0,
|
1576 |
+
0x1ed100001ed2,
|
1577 |
+
0x1ed300001ed4,
|
1578 |
+
0x1ed500001ed6,
|
1579 |
+
0x1ed700001ed8,
|
1580 |
+
0x1ed900001eda,
|
1581 |
+
0x1edb00001edc,
|
1582 |
+
0x1edd00001ede,
|
1583 |
+
0x1edf00001ee0,
|
1584 |
+
0x1ee100001ee2,
|
1585 |
+
0x1ee300001ee4,
|
1586 |
+
0x1ee500001ee6,
|
1587 |
+
0x1ee700001ee8,
|
1588 |
+
0x1ee900001eea,
|
1589 |
+
0x1eeb00001eec,
|
1590 |
+
0x1eed00001eee,
|
1591 |
+
0x1eef00001ef0,
|
1592 |
+
0x1ef100001ef2,
|
1593 |
+
0x1ef300001ef4,
|
1594 |
+
0x1ef500001ef6,
|
1595 |
+
0x1ef700001ef8,
|
1596 |
+
0x1ef900001efa,
|
1597 |
+
0x1efb00001efc,
|
1598 |
+
0x1efd00001efe,
|
1599 |
+
0x1eff00001f08,
|
1600 |
+
0x1f1000001f16,
|
1601 |
+
0x1f2000001f28,
|
1602 |
+
0x1f3000001f38,
|
1603 |
+
0x1f4000001f46,
|
1604 |
+
0x1f5000001f58,
|
1605 |
+
0x1f6000001f68,
|
1606 |
+
0x1f7000001f71,
|
1607 |
+
0x1f7200001f73,
|
1608 |
+
0x1f7400001f75,
|
1609 |
+
0x1f7600001f77,
|
1610 |
+
0x1f7800001f79,
|
1611 |
+
0x1f7a00001f7b,
|
1612 |
+
0x1f7c00001f7d,
|
1613 |
+
0x1fb000001fb2,
|
1614 |
+
0x1fb600001fb7,
|
1615 |
+
0x1fc600001fc7,
|
1616 |
+
0x1fd000001fd3,
|
1617 |
+
0x1fd600001fd8,
|
1618 |
+
0x1fe000001fe3,
|
1619 |
+
0x1fe400001fe8,
|
1620 |
+
0x1ff600001ff7,
|
1621 |
+
0x214e0000214f,
|
1622 |
+
0x218400002185,
|
1623 |
+
0x2c3000002c60,
|
1624 |
+
0x2c6100002c62,
|
1625 |
+
0x2c6500002c67,
|
1626 |
+
0x2c6800002c69,
|
1627 |
+
0x2c6a00002c6b,
|
1628 |
+
0x2c6c00002c6d,
|
1629 |
+
0x2c7100002c72,
|
1630 |
+
0x2c7300002c75,
|
1631 |
+
0x2c7600002c7c,
|
1632 |
+
0x2c8100002c82,
|
1633 |
+
0x2c8300002c84,
|
1634 |
+
0x2c8500002c86,
|
1635 |
+
0x2c8700002c88,
|
1636 |
+
0x2c8900002c8a,
|
1637 |
+
0x2c8b00002c8c,
|
1638 |
+
0x2c8d00002c8e,
|
1639 |
+
0x2c8f00002c90,
|
1640 |
+
0x2c9100002c92,
|
1641 |
+
0x2c9300002c94,
|
1642 |
+
0x2c9500002c96,
|
1643 |
+
0x2c9700002c98,
|
1644 |
+
0x2c9900002c9a,
|
1645 |
+
0x2c9b00002c9c,
|
1646 |
+
0x2c9d00002c9e,
|
1647 |
+
0x2c9f00002ca0,
|
1648 |
+
0x2ca100002ca2,
|
1649 |
+
0x2ca300002ca4,
|
1650 |
+
0x2ca500002ca6,
|
1651 |
+
0x2ca700002ca8,
|
1652 |
+
0x2ca900002caa,
|
1653 |
+
0x2cab00002cac,
|
1654 |
+
0x2cad00002cae,
|
1655 |
+
0x2caf00002cb0,
|
1656 |
+
0x2cb100002cb2,
|
1657 |
+
0x2cb300002cb4,
|
1658 |
+
0x2cb500002cb6,
|
1659 |
+
0x2cb700002cb8,
|
1660 |
+
0x2cb900002cba,
|
1661 |
+
0x2cbb00002cbc,
|
1662 |
+
0x2cbd00002cbe,
|
1663 |
+
0x2cbf00002cc0,
|
1664 |
+
0x2cc100002cc2,
|
1665 |
+
0x2cc300002cc4,
|
1666 |
+
0x2cc500002cc6,
|
1667 |
+
0x2cc700002cc8,
|
1668 |
+
0x2cc900002cca,
|
1669 |
+
0x2ccb00002ccc,
|
1670 |
+
0x2ccd00002cce,
|
1671 |
+
0x2ccf00002cd0,
|
1672 |
+
0x2cd100002cd2,
|
1673 |
+
0x2cd300002cd4,
|
1674 |
+
0x2cd500002cd6,
|
1675 |
+
0x2cd700002cd8,
|
1676 |
+
0x2cd900002cda,
|
1677 |
+
0x2cdb00002cdc,
|
1678 |
+
0x2cdd00002cde,
|
1679 |
+
0x2cdf00002ce0,
|
1680 |
+
0x2ce100002ce2,
|
1681 |
+
0x2ce300002ce5,
|
1682 |
+
0x2cec00002ced,
|
1683 |
+
0x2cee00002cf2,
|
1684 |
+
0x2cf300002cf4,
|
1685 |
+
0x2d0000002d26,
|
1686 |
+
0x2d2700002d28,
|
1687 |
+
0x2d2d00002d2e,
|
1688 |
+
0x2d3000002d68,
|
1689 |
+
0x2d7f00002d97,
|
1690 |
+
0x2da000002da7,
|
1691 |
+
0x2da800002daf,
|
1692 |
+
0x2db000002db7,
|
1693 |
+
0x2db800002dbf,
|
1694 |
+
0x2dc000002dc7,
|
1695 |
+
0x2dc800002dcf,
|
1696 |
+
0x2dd000002dd7,
|
1697 |
+
0x2dd800002ddf,
|
1698 |
+
0x2de000002e00,
|
1699 |
+
0x2e2f00002e30,
|
1700 |
+
0x300500003008,
|
1701 |
+
0x302a0000302e,
|
1702 |
+
0x303c0000303d,
|
1703 |
+
0x304100003097,
|
1704 |
+
0x30990000309b,
|
1705 |
+
0x309d0000309f,
|
1706 |
+
0x30a1000030fb,
|
1707 |
+
0x30fc000030ff,
|
1708 |
+
0x310500003130,
|
1709 |
+
0x31a0000031c0,
|
1710 |
+
0x31f000003200,
|
1711 |
+
0x340000004dc0,
|
1712 |
+
0x4e000000a48d,
|
1713 |
+
0xa4d00000a4fe,
|
1714 |
+
0xa5000000a60d,
|
1715 |
+
0xa6100000a62c,
|
1716 |
+
0xa6410000a642,
|
1717 |
+
0xa6430000a644,
|
1718 |
+
0xa6450000a646,
|
1719 |
+
0xa6470000a648,
|
1720 |
+
0xa6490000a64a,
|
1721 |
+
0xa64b0000a64c,
|
1722 |
+
0xa64d0000a64e,
|
1723 |
+
0xa64f0000a650,
|
1724 |
+
0xa6510000a652,
|
1725 |
+
0xa6530000a654,
|
1726 |
+
0xa6550000a656,
|
1727 |
+
0xa6570000a658,
|
1728 |
+
0xa6590000a65a,
|
1729 |
+
0xa65b0000a65c,
|
1730 |
+
0xa65d0000a65e,
|
1731 |
+
0xa65f0000a660,
|
1732 |
+
0xa6610000a662,
|
1733 |
+
0xa6630000a664,
|
1734 |
+
0xa6650000a666,
|
1735 |
+
0xa6670000a668,
|
1736 |
+
0xa6690000a66a,
|
1737 |
+
0xa66b0000a66c,
|
1738 |
+
0xa66d0000a670,
|
1739 |
+
0xa6740000a67e,
|
1740 |
+
0xa67f0000a680,
|
1741 |
+
0xa6810000a682,
|
1742 |
+
0xa6830000a684,
|
1743 |
+
0xa6850000a686,
|
1744 |
+
0xa6870000a688,
|
1745 |
+
0xa6890000a68a,
|
1746 |
+
0xa68b0000a68c,
|
1747 |
+
0xa68d0000a68e,
|
1748 |
+
0xa68f0000a690,
|
1749 |
+
0xa6910000a692,
|
1750 |
+
0xa6930000a694,
|
1751 |
+
0xa6950000a696,
|
1752 |
+
0xa6970000a698,
|
1753 |
+
0xa6990000a69a,
|
1754 |
+
0xa69b0000a69c,
|
1755 |
+
0xa69e0000a6e6,
|
1756 |
+
0xa6f00000a6f2,
|
1757 |
+
0xa7170000a720,
|
1758 |
+
0xa7230000a724,
|
1759 |
+
0xa7250000a726,
|
1760 |
+
0xa7270000a728,
|
1761 |
+
0xa7290000a72a,
|
1762 |
+
0xa72b0000a72c,
|
1763 |
+
0xa72d0000a72e,
|
1764 |
+
0xa72f0000a732,
|
1765 |
+
0xa7330000a734,
|
1766 |
+
0xa7350000a736,
|
1767 |
+
0xa7370000a738,
|
1768 |
+
0xa7390000a73a,
|
1769 |
+
0xa73b0000a73c,
|
1770 |
+
0xa73d0000a73e,
|
1771 |
+
0xa73f0000a740,
|
1772 |
+
0xa7410000a742,
|
1773 |
+
0xa7430000a744,
|
1774 |
+
0xa7450000a746,
|
1775 |
+
0xa7470000a748,
|
1776 |
+
0xa7490000a74a,
|
1777 |
+
0xa74b0000a74c,
|
1778 |
+
0xa74d0000a74e,
|
1779 |
+
0xa74f0000a750,
|
1780 |
+
0xa7510000a752,
|
1781 |
+
0xa7530000a754,
|
1782 |
+
0xa7550000a756,
|
1783 |
+
0xa7570000a758,
|
1784 |
+
0xa7590000a75a,
|
1785 |
+
0xa75b0000a75c,
|
1786 |
+
0xa75d0000a75e,
|
1787 |
+
0xa75f0000a760,
|
1788 |
+
0xa7610000a762,
|
1789 |
+
0xa7630000a764,
|
1790 |
+
0xa7650000a766,
|
1791 |
+
0xa7670000a768,
|
1792 |
+
0xa7690000a76a,
|
1793 |
+
0xa76b0000a76c,
|
1794 |
+
0xa76d0000a76e,
|
1795 |
+
0xa76f0000a770,
|
1796 |
+
0xa7710000a779,
|
1797 |
+
0xa77a0000a77b,
|
1798 |
+
0xa77c0000a77d,
|
1799 |
+
0xa77f0000a780,
|
1800 |
+
0xa7810000a782,
|
1801 |
+
0xa7830000a784,
|
1802 |
+
0xa7850000a786,
|
1803 |
+
0xa7870000a789,
|
1804 |
+
0xa78c0000a78d,
|
1805 |
+
0xa78e0000a790,
|
1806 |
+
0xa7910000a792,
|
1807 |
+
0xa7930000a796,
|
1808 |
+
0xa7970000a798,
|
1809 |
+
0xa7990000a79a,
|
1810 |
+
0xa79b0000a79c,
|
1811 |
+
0xa79d0000a79e,
|
1812 |
+
0xa79f0000a7a0,
|
1813 |
+
0xa7a10000a7a2,
|
1814 |
+
0xa7a30000a7a4,
|
1815 |
+
0xa7a50000a7a6,
|
1816 |
+
0xa7a70000a7a8,
|
1817 |
+
0xa7a90000a7aa,
|
1818 |
+
0xa7af0000a7b0,
|
1819 |
+
0xa7b50000a7b6,
|
1820 |
+
0xa7b70000a7b8,
|
1821 |
+
0xa7b90000a7ba,
|
1822 |
+
0xa7bb0000a7bc,
|
1823 |
+
0xa7bd0000a7be,
|
1824 |
+
0xa7bf0000a7c0,
|
1825 |
+
0xa7c10000a7c2,
|
1826 |
+
0xa7c30000a7c4,
|
1827 |
+
0xa7c80000a7c9,
|
1828 |
+
0xa7ca0000a7cb,
|
1829 |
+
0xa7d10000a7d2,
|
1830 |
+
0xa7d30000a7d4,
|
1831 |
+
0xa7d50000a7d6,
|
1832 |
+
0xa7d70000a7d8,
|
1833 |
+
0xa7d90000a7da,
|
1834 |
+
0xa7f20000a7f5,
|
1835 |
+
0xa7f60000a7f8,
|
1836 |
+
0xa7fa0000a828,
|
1837 |
+
0xa82c0000a82d,
|
1838 |
+
0xa8400000a874,
|
1839 |
+
0xa8800000a8c6,
|
1840 |
+
0xa8d00000a8da,
|
1841 |
+
0xa8e00000a8f8,
|
1842 |
+
0xa8fb0000a8fc,
|
1843 |
+
0xa8fd0000a92e,
|
1844 |
+
0xa9300000a954,
|
1845 |
+
0xa9800000a9c1,
|
1846 |
+
0xa9cf0000a9da,
|
1847 |
+
0xa9e00000a9ff,
|
1848 |
+
0xaa000000aa37,
|
1849 |
+
0xaa400000aa4e,
|
1850 |
+
0xaa500000aa5a,
|
1851 |
+
0xaa600000aa77,
|
1852 |
+
0xaa7a0000aac3,
|
1853 |
+
0xaadb0000aade,
|
1854 |
+
0xaae00000aaf0,
|
1855 |
+
0xaaf20000aaf7,
|
1856 |
+
0xab010000ab07,
|
1857 |
+
0xab090000ab0f,
|
1858 |
+
0xab110000ab17,
|
1859 |
+
0xab200000ab27,
|
1860 |
+
0xab280000ab2f,
|
1861 |
+
0xab300000ab5b,
|
1862 |
+
0xab600000ab6a,
|
1863 |
+
0xabc00000abeb,
|
1864 |
+
0xabec0000abee,
|
1865 |
+
0xabf00000abfa,
|
1866 |
+
0xac000000d7a4,
|
1867 |
+
0xfa0e0000fa10,
|
1868 |
+
0xfa110000fa12,
|
1869 |
+
0xfa130000fa15,
|
1870 |
+
0xfa1f0000fa20,
|
1871 |
+
0xfa210000fa22,
|
1872 |
+
0xfa230000fa25,
|
1873 |
+
0xfa270000fa2a,
|
1874 |
+
0xfb1e0000fb1f,
|
1875 |
+
0xfe200000fe30,
|
1876 |
+
0xfe730000fe74,
|
1877 |
+
0x100000001000c,
|
1878 |
+
0x1000d00010027,
|
1879 |
+
0x100280001003b,
|
1880 |
+
0x1003c0001003e,
|
1881 |
+
0x1003f0001004e,
|
1882 |
+
0x100500001005e,
|
1883 |
+
0x10080000100fb,
|
1884 |
+
0x101fd000101fe,
|
1885 |
+
0x102800001029d,
|
1886 |
+
0x102a0000102d1,
|
1887 |
+
0x102e0000102e1,
|
1888 |
+
0x1030000010320,
|
1889 |
+
0x1032d00010341,
|
1890 |
+
0x103420001034a,
|
1891 |
+
0x103500001037b,
|
1892 |
+
0x103800001039e,
|
1893 |
+
0x103a0000103c4,
|
1894 |
+
0x103c8000103d0,
|
1895 |
+
0x104280001049e,
|
1896 |
+
0x104a0000104aa,
|
1897 |
+
0x104d8000104fc,
|
1898 |
+
0x1050000010528,
|
1899 |
+
0x1053000010564,
|
1900 |
+
0x10597000105a2,
|
1901 |
+
0x105a3000105b2,
|
1902 |
+
0x105b3000105ba,
|
1903 |
+
0x105bb000105bd,
|
1904 |
+
0x1060000010737,
|
1905 |
+
0x1074000010756,
|
1906 |
+
0x1076000010768,
|
1907 |
+
0x1078000010786,
|
1908 |
+
0x10787000107b1,
|
1909 |
+
0x107b2000107bb,
|
1910 |
+
0x1080000010806,
|
1911 |
+
0x1080800010809,
|
1912 |
+
0x1080a00010836,
|
1913 |
+
0x1083700010839,
|
1914 |
+
0x1083c0001083d,
|
1915 |
+
0x1083f00010856,
|
1916 |
+
0x1086000010877,
|
1917 |
+
0x108800001089f,
|
1918 |
+
0x108e0000108f3,
|
1919 |
+
0x108f4000108f6,
|
1920 |
+
0x1090000010916,
|
1921 |
+
0x109200001093a,
|
1922 |
+
0x10980000109b8,
|
1923 |
+
0x109be000109c0,
|
1924 |
+
0x10a0000010a04,
|
1925 |
+
0x10a0500010a07,
|
1926 |
+
0x10a0c00010a14,
|
1927 |
+
0x10a1500010a18,
|
1928 |
+
0x10a1900010a36,
|
1929 |
+
0x10a3800010a3b,
|
1930 |
+
0x10a3f00010a40,
|
1931 |
+
0x10a6000010a7d,
|
1932 |
+
0x10a8000010a9d,
|
1933 |
+
0x10ac000010ac8,
|
1934 |
+
0x10ac900010ae7,
|
1935 |
+
0x10b0000010b36,
|
1936 |
+
0x10b4000010b56,
|
1937 |
+
0x10b6000010b73,
|
1938 |
+
0x10b8000010b92,
|
1939 |
+
0x10c0000010c49,
|
1940 |
+
0x10cc000010cf3,
|
1941 |
+
0x10d0000010d28,
|
1942 |
+
0x10d3000010d3a,
|
1943 |
+
0x10e8000010eaa,
|
1944 |
+
0x10eab00010ead,
|
1945 |
+
0x10eb000010eb2,
|
1946 |
+
0x10f0000010f1d,
|
1947 |
+
0x10f2700010f28,
|
1948 |
+
0x10f3000010f51,
|
1949 |
+
0x10f7000010f86,
|
1950 |
+
0x10fb000010fc5,
|
1951 |
+
0x10fe000010ff7,
|
1952 |
+
0x1100000011047,
|
1953 |
+
0x1106600011076,
|
1954 |
+
0x1107f000110bb,
|
1955 |
+
0x110c2000110c3,
|
1956 |
+
0x110d0000110e9,
|
1957 |
+
0x110f0000110fa,
|
1958 |
+
0x1110000011135,
|
1959 |
+
0x1113600011140,
|
1960 |
+
0x1114400011148,
|
1961 |
+
0x1115000011174,
|
1962 |
+
0x1117600011177,
|
1963 |
+
0x11180000111c5,
|
1964 |
+
0x111c9000111cd,
|
1965 |
+
0x111ce000111db,
|
1966 |
+
0x111dc000111dd,
|
1967 |
+
0x1120000011212,
|
1968 |
+
0x1121300011238,
|
1969 |
+
0x1123e0001123f,
|
1970 |
+
0x1128000011287,
|
1971 |
+
0x1128800011289,
|
1972 |
+
0x1128a0001128e,
|
1973 |
+
0x1128f0001129e,
|
1974 |
+
0x1129f000112a9,
|
1975 |
+
0x112b0000112eb,
|
1976 |
+
0x112f0000112fa,
|
1977 |
+
0x1130000011304,
|
1978 |
+
0x113050001130d,
|
1979 |
+
0x1130f00011311,
|
1980 |
+
0x1131300011329,
|
1981 |
+
0x1132a00011331,
|
1982 |
+
0x1133200011334,
|
1983 |
+
0x113350001133a,
|
1984 |
+
0x1133b00011345,
|
1985 |
+
0x1134700011349,
|
1986 |
+
0x1134b0001134e,
|
1987 |
+
0x1135000011351,
|
1988 |
+
0x1135700011358,
|
1989 |
+
0x1135d00011364,
|
1990 |
+
0x113660001136d,
|
1991 |
+
0x1137000011375,
|
1992 |
+
0x114000001144b,
|
1993 |
+
0x114500001145a,
|
1994 |
+
0x1145e00011462,
|
1995 |
+
0x11480000114c6,
|
1996 |
+
0x114c7000114c8,
|
1997 |
+
0x114d0000114da,
|
1998 |
+
0x11580000115b6,
|
1999 |
+
0x115b8000115c1,
|
2000 |
+
0x115d8000115de,
|
2001 |
+
0x1160000011641,
|
2002 |
+
0x1164400011645,
|
2003 |
+
0x116500001165a,
|
2004 |
+
0x11680000116b9,
|
2005 |
+
0x116c0000116ca,
|
2006 |
+
0x117000001171b,
|
2007 |
+
0x1171d0001172c,
|
2008 |
+
0x117300001173a,
|
2009 |
+
0x1174000011747,
|
2010 |
+
0x118000001183b,
|
2011 |
+
0x118c0000118ea,
|
2012 |
+
0x118ff00011907,
|
2013 |
+
0x119090001190a,
|
2014 |
+
0x1190c00011914,
|
2015 |
+
0x1191500011917,
|
2016 |
+
0x1191800011936,
|
2017 |
+
0x1193700011939,
|
2018 |
+
0x1193b00011944,
|
2019 |
+
0x119500001195a,
|
2020 |
+
0x119a0000119a8,
|
2021 |
+
0x119aa000119d8,
|
2022 |
+
0x119da000119e2,
|
2023 |
+
0x119e3000119e5,
|
2024 |
+
0x11a0000011a3f,
|
2025 |
+
0x11a4700011a48,
|
2026 |
+
0x11a5000011a9a,
|
2027 |
+
0x11a9d00011a9e,
|
2028 |
+
0x11ab000011af9,
|
2029 |
+
0x11c0000011c09,
|
2030 |
+
0x11c0a00011c37,
|
2031 |
+
0x11c3800011c41,
|
2032 |
+
0x11c5000011c5a,
|
2033 |
+
0x11c7200011c90,
|
2034 |
+
0x11c9200011ca8,
|
2035 |
+
0x11ca900011cb7,
|
2036 |
+
0x11d0000011d07,
|
2037 |
+
0x11d0800011d0a,
|
2038 |
+
0x11d0b00011d37,
|
2039 |
+
0x11d3a00011d3b,
|
2040 |
+
0x11d3c00011d3e,
|
2041 |
+
0x11d3f00011d48,
|
2042 |
+
0x11d5000011d5a,
|
2043 |
+
0x11d6000011d66,
|
2044 |
+
0x11d6700011d69,
|
2045 |
+
0x11d6a00011d8f,
|
2046 |
+
0x11d9000011d92,
|
2047 |
+
0x11d9300011d99,
|
2048 |
+
0x11da000011daa,
|
2049 |
+
0x11ee000011ef7,
|
2050 |
+
0x11fb000011fb1,
|
2051 |
+
0x120000001239a,
|
2052 |
+
0x1248000012544,
|
2053 |
+
0x12f9000012ff1,
|
2054 |
+
0x130000001342f,
|
2055 |
+
0x1440000014647,
|
2056 |
+
0x1680000016a39,
|
2057 |
+
0x16a4000016a5f,
|
2058 |
+
0x16a6000016a6a,
|
2059 |
+
0x16a7000016abf,
|
2060 |
+
0x16ac000016aca,
|
2061 |
+
0x16ad000016aee,
|
2062 |
+
0x16af000016af5,
|
2063 |
+
0x16b0000016b37,
|
2064 |
+
0x16b4000016b44,
|
2065 |
+
0x16b5000016b5a,
|
2066 |
+
0x16b6300016b78,
|
2067 |
+
0x16b7d00016b90,
|
2068 |
+
0x16e6000016e80,
|
2069 |
+
0x16f0000016f4b,
|
2070 |
+
0x16f4f00016f88,
|
2071 |
+
0x16f8f00016fa0,
|
2072 |
+
0x16fe000016fe2,
|
2073 |
+
0x16fe300016fe5,
|
2074 |
+
0x16ff000016ff2,
|
2075 |
+
0x17000000187f8,
|
2076 |
+
0x1880000018cd6,
|
2077 |
+
0x18d0000018d09,
|
2078 |
+
0x1aff00001aff4,
|
2079 |
+
0x1aff50001affc,
|
2080 |
+
0x1affd0001afff,
|
2081 |
+
0x1b0000001b123,
|
2082 |
+
0x1b1500001b153,
|
2083 |
+
0x1b1640001b168,
|
2084 |
+
0x1b1700001b2fc,
|
2085 |
+
0x1bc000001bc6b,
|
2086 |
+
0x1bc700001bc7d,
|
2087 |
+
0x1bc800001bc89,
|
2088 |
+
0x1bc900001bc9a,
|
2089 |
+
0x1bc9d0001bc9f,
|
2090 |
+
0x1cf000001cf2e,
|
2091 |
+
0x1cf300001cf47,
|
2092 |
+
0x1da000001da37,
|
2093 |
+
0x1da3b0001da6d,
|
2094 |
+
0x1da750001da76,
|
2095 |
+
0x1da840001da85,
|
2096 |
+
0x1da9b0001daa0,
|
2097 |
+
0x1daa10001dab0,
|
2098 |
+
0x1df000001df1f,
|
2099 |
+
0x1e0000001e007,
|
2100 |
+
0x1e0080001e019,
|
2101 |
+
0x1e01b0001e022,
|
2102 |
+
0x1e0230001e025,
|
2103 |
+
0x1e0260001e02b,
|
2104 |
+
0x1e1000001e12d,
|
2105 |
+
0x1e1300001e13e,
|
2106 |
+
0x1e1400001e14a,
|
2107 |
+
0x1e14e0001e14f,
|
2108 |
+
0x1e2900001e2af,
|
2109 |
+
0x1e2c00001e2fa,
|
2110 |
+
0x1e7e00001e7e7,
|
2111 |
+
0x1e7e80001e7ec,
|
2112 |
+
0x1e7ed0001e7ef,
|
2113 |
+
0x1e7f00001e7ff,
|
2114 |
+
0x1e8000001e8c5,
|
2115 |
+
0x1e8d00001e8d7,
|
2116 |
+
0x1e9220001e94c,
|
2117 |
+
0x1e9500001e95a,
|
2118 |
+
0x1fbf00001fbfa,
|
2119 |
+
0x200000002a6e0,
|
2120 |
+
0x2a7000002b739,
|
2121 |
+
0x2b7400002b81e,
|
2122 |
+
0x2b8200002cea2,
|
2123 |
+
0x2ceb00002ebe1,
|
2124 |
+
0x300000003134b,
|
2125 |
+
),
|
2126 |
+
'CONTEXTJ': (
|
2127 |
+
0x200c0000200e,
|
2128 |
+
),
|
2129 |
+
'CONTEXTO': (
|
2130 |
+
0xb7000000b8,
|
2131 |
+
0x37500000376,
|
2132 |
+
0x5f3000005f5,
|
2133 |
+
0x6600000066a,
|
2134 |
+
0x6f0000006fa,
|
2135 |
+
0x30fb000030fc,
|
2136 |
+
),
|
2137 |
+
}
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/intranges.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Given a list of integers, made up of (hopefully) a small number of long runs
|
3 |
+
of consecutive integers, compute a representation of the form
|
4 |
+
((start1, end1), (start2, end2) ...). Then answer the question "was x present
|
5 |
+
in the original list?" in time O(log(# runs)).
|
6 |
+
"""
|
7 |
+
|
8 |
+
import bisect
|
9 |
+
from typing import List, Tuple
|
10 |
+
|
11 |
+
def intranges_from_list(list_: List[int]) -> Tuple[int, ...]:
|
12 |
+
"""Represent a list of integers as a sequence of ranges:
|
13 |
+
((start_0, end_0), (start_1, end_1), ...), such that the original
|
14 |
+
integers are exactly those x such that start_i <= x < end_i for some i.
|
15 |
+
|
16 |
+
Ranges are encoded as single integers (start << 32 | end), not as tuples.
|
17 |
+
"""
|
18 |
+
|
19 |
+
sorted_list = sorted(list_)
|
20 |
+
ranges = []
|
21 |
+
last_write = -1
|
22 |
+
for i in range(len(sorted_list)):
|
23 |
+
if i+1 < len(sorted_list):
|
24 |
+
if sorted_list[i] == sorted_list[i+1]-1:
|
25 |
+
continue
|
26 |
+
current_range = sorted_list[last_write+1:i+1]
|
27 |
+
ranges.append(_encode_range(current_range[0], current_range[-1] + 1))
|
28 |
+
last_write = i
|
29 |
+
|
30 |
+
return tuple(ranges)
|
31 |
+
|
32 |
+
def _encode_range(start: int, end: int) -> int:
|
33 |
+
return (start << 32) | end
|
34 |
+
|
35 |
+
def _decode_range(r: int) -> Tuple[int, int]:
|
36 |
+
return (r >> 32), (r & ((1 << 32) - 1))
|
37 |
+
|
38 |
+
|
39 |
+
def intranges_contain(int_: int, ranges: Tuple[int, ...]) -> bool:
|
40 |
+
"""Determine if `int_` falls into one of the ranges in `ranges`."""
|
41 |
+
tuple_ = _encode_range(int_, 0)
|
42 |
+
pos = bisect.bisect_left(ranges, tuple_)
|
43 |
+
# we could be immediately ahead of a tuple (start, end)
|
44 |
+
# with start < int_ <= end
|
45 |
+
if pos > 0:
|
46 |
+
left, right = _decode_range(ranges[pos-1])
|
47 |
+
if left <= int_ < right:
|
48 |
+
return True
|
49 |
+
# or we could be immediately behind a tuple (int_, end)
|
50 |
+
if pos < len(ranges):
|
51 |
+
left, _ = _decode_range(ranges[pos])
|
52 |
+
if left == int_:
|
53 |
+
return True
|
54 |
+
return False
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/package_data.py
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
__version__ = '3.3'
|
2 |
+
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/idna/uts46data.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/cmdline.py
ADDED
@@ -0,0 +1,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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
pygments.cmdline
|
3 |
+
~~~~~~~~~~~~~~~~
|
4 |
+
|
5 |
+
Command line interface.
|
6 |
+
|
7 |
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
|
8 |
+
:license: BSD, see LICENSE for details.
|
9 |
+
"""
|
10 |
+
|
11 |
+
import os
|
12 |
+
import sys
|
13 |
+
import shutil
|
14 |
+
import argparse
|
15 |
+
from textwrap import dedent
|
16 |
+
|
17 |
+
from pip._vendor.pygments import __version__, highlight
|
18 |
+
from pip._vendor.pygments.util import ClassNotFound, OptionError, docstring_headline, \
|
19 |
+
guess_decode, guess_decode_from_terminal, terminal_encoding, \
|
20 |
+
UnclosingTextIOWrapper
|
21 |
+
from pip._vendor.pygments.lexers import get_all_lexers, get_lexer_by_name, guess_lexer, \
|
22 |
+
load_lexer_from_file, get_lexer_for_filename, find_lexer_class_for_filename
|
23 |
+
from pip._vendor.pygments.lexers.special import TextLexer
|
24 |
+
from pip._vendor.pygments.formatters.latex import LatexEmbeddedLexer, LatexFormatter
|
25 |
+
from pip._vendor.pygments.formatters import get_all_formatters, get_formatter_by_name, \
|
26 |
+
load_formatter_from_file, get_formatter_for_filename, find_formatter_class
|
27 |
+
from pip._vendor.pygments.formatters.terminal import TerminalFormatter
|
28 |
+
from pip._vendor.pygments.formatters.terminal256 import Terminal256Formatter
|
29 |
+
from pip._vendor.pygments.filters import get_all_filters, find_filter_class
|
30 |
+
from pip._vendor.pygments.styles import get_all_styles, get_style_by_name
|
31 |
+
|
32 |
+
|
33 |
+
def _parse_options(o_strs):
|
34 |
+
opts = {}
|
35 |
+
if not o_strs:
|
36 |
+
return opts
|
37 |
+
for o_str in o_strs:
|
38 |
+
if not o_str.strip():
|
39 |
+
continue
|
40 |
+
o_args = o_str.split(',')
|
41 |
+
for o_arg in o_args:
|
42 |
+
o_arg = o_arg.strip()
|
43 |
+
try:
|
44 |
+
o_key, o_val = o_arg.split('=', 1)
|
45 |
+
o_key = o_key.strip()
|
46 |
+
o_val = o_val.strip()
|
47 |
+
except ValueError:
|
48 |
+
opts[o_arg] = True
|
49 |
+
else:
|
50 |
+
opts[o_key] = o_val
|
51 |
+
return opts
|
52 |
+
|
53 |
+
|
54 |
+
def _parse_filters(f_strs):
|
55 |
+
filters = []
|
56 |
+
if not f_strs:
|
57 |
+
return filters
|
58 |
+
for f_str in f_strs:
|
59 |
+
if ':' in f_str:
|
60 |
+
fname, fopts = f_str.split(':', 1)
|
61 |
+
filters.append((fname, _parse_options([fopts])))
|
62 |
+
else:
|
63 |
+
filters.append((f_str, {}))
|
64 |
+
return filters
|
65 |
+
|
66 |
+
|
67 |
+
def _print_help(what, name):
|
68 |
+
try:
|
69 |
+
if what == 'lexer':
|
70 |
+
cls = get_lexer_by_name(name)
|
71 |
+
print("Help on the %s lexer:" % cls.name)
|
72 |
+
print(dedent(cls.__doc__))
|
73 |
+
elif what == 'formatter':
|
74 |
+
cls = find_formatter_class(name)
|
75 |
+
print("Help on the %s formatter:" % cls.name)
|
76 |
+
print(dedent(cls.__doc__))
|
77 |
+
elif what == 'filter':
|
78 |
+
cls = find_filter_class(name)
|
79 |
+
print("Help on the %s filter:" % name)
|
80 |
+
print(dedent(cls.__doc__))
|
81 |
+
return 0
|
82 |
+
except (AttributeError, ValueError):
|
83 |
+
print("%s not found!" % what, file=sys.stderr)
|
84 |
+
return 1
|
85 |
+
|
86 |
+
|
87 |
+
def _print_list(what):
|
88 |
+
if what == 'lexer':
|
89 |
+
print()
|
90 |
+
print("Lexers:")
|
91 |
+
print("~~~~~~~")
|
92 |
+
|
93 |
+
info = []
|
94 |
+
for fullname, names, exts, _ in get_all_lexers():
|
95 |
+
tup = (', '.join(names)+':', fullname,
|
96 |
+
exts and '(filenames ' + ', '.join(exts) + ')' or '')
|
97 |
+
info.append(tup)
|
98 |
+
info.sort()
|
99 |
+
for i in info:
|
100 |
+
print(('* %s\n %s %s') % i)
|
101 |
+
|
102 |
+
elif what == 'formatter':
|
103 |
+
print()
|
104 |
+
print("Formatters:")
|
105 |
+
print("~~~~~~~~~~~")
|
106 |
+
|
107 |
+
info = []
|
108 |
+
for cls in get_all_formatters():
|
109 |
+
doc = docstring_headline(cls)
|
110 |
+
tup = (', '.join(cls.aliases) + ':', doc, cls.filenames and
|
111 |
+
'(filenames ' + ', '.join(cls.filenames) + ')' or '')
|
112 |
+
info.append(tup)
|
113 |
+
info.sort()
|
114 |
+
for i in info:
|
115 |
+
print(('* %s\n %s %s') % i)
|
116 |
+
|
117 |
+
elif what == 'filter':
|
118 |
+
print()
|
119 |
+
print("Filters:")
|
120 |
+
print("~~~~~~~~")
|
121 |
+
|
122 |
+
for name in get_all_filters():
|
123 |
+
cls = find_filter_class(name)
|
124 |
+
print("* " + name + ':')
|
125 |
+
print(" %s" % docstring_headline(cls))
|
126 |
+
|
127 |
+
elif what == 'style':
|
128 |
+
print()
|
129 |
+
print("Styles:")
|
130 |
+
print("~~~~~~~")
|
131 |
+
|
132 |
+
for name in get_all_styles():
|
133 |
+
cls = get_style_by_name(name)
|
134 |
+
print("* " + name + ':')
|
135 |
+
print(" %s" % docstring_headline(cls))
|
136 |
+
|
137 |
+
|
138 |
+
def _print_list_as_json(requested_items):
|
139 |
+
import json
|
140 |
+
result = {}
|
141 |
+
if 'lexer' in requested_items:
|
142 |
+
info = {}
|
143 |
+
for fullname, names, filenames, mimetypes in get_all_lexers():
|
144 |
+
info[fullname] = {
|
145 |
+
'aliases': names,
|
146 |
+
'filenames': filenames,
|
147 |
+
'mimetypes': mimetypes
|
148 |
+
}
|
149 |
+
result['lexers'] = info
|
150 |
+
|
151 |
+
if 'formatter' in requested_items:
|
152 |
+
info = {}
|
153 |
+
for cls in get_all_formatters():
|
154 |
+
doc = docstring_headline(cls)
|
155 |
+
info[cls.name] = {
|
156 |
+
'aliases': cls.aliases,
|
157 |
+
'filenames': cls.filenames,
|
158 |
+
'doc': doc
|
159 |
+
}
|
160 |
+
result['formatters'] = info
|
161 |
+
|
162 |
+
if 'filter' in requested_items:
|
163 |
+
info = {}
|
164 |
+
for name in get_all_filters():
|
165 |
+
cls = find_filter_class(name)
|
166 |
+
info[name] = {
|
167 |
+
'doc': docstring_headline(cls)
|
168 |
+
}
|
169 |
+
result['filters'] = info
|
170 |
+
|
171 |
+
if 'style' in requested_items:
|
172 |
+
info = {}
|
173 |
+
for name in get_all_styles():
|
174 |
+
cls = get_style_by_name(name)
|
175 |
+
info[name] = {
|
176 |
+
'doc': docstring_headline(cls)
|
177 |
+
}
|
178 |
+
result['styles'] = info
|
179 |
+
|
180 |
+
json.dump(result, sys.stdout)
|
181 |
+
|
182 |
+
def main_inner(parser, argns):
|
183 |
+
if argns.help:
|
184 |
+
parser.print_help()
|
185 |
+
return 0
|
186 |
+
|
187 |
+
if argns.V:
|
188 |
+
print('Pygments version %s, (c) 2006-2021 by Georg Brandl, Matthäus '
|
189 |
+
'Chajdas and contributors.' % __version__)
|
190 |
+
return 0
|
191 |
+
|
192 |
+
def is_only_option(opt):
|
193 |
+
return not any(v for (k, v) in vars(argns).items() if k != opt)
|
194 |
+
|
195 |
+
# handle ``pygmentize -L``
|
196 |
+
if argns.L is not None:
|
197 |
+
arg_set = set()
|
198 |
+
for k, v in vars(argns).items():
|
199 |
+
if v:
|
200 |
+
arg_set.add(k)
|
201 |
+
|
202 |
+
arg_set.discard('L')
|
203 |
+
arg_set.discard('json')
|
204 |
+
|
205 |
+
if arg_set:
|
206 |
+
parser.print_help(sys.stderr)
|
207 |
+
return 2
|
208 |
+
|
209 |
+
# print version
|
210 |
+
if not argns.json:
|
211 |
+
main(['', '-V'])
|
212 |
+
allowed_types = {'lexer', 'formatter', 'filter', 'style'}
|
213 |
+
largs = [arg.rstrip('s') for arg in argns.L]
|
214 |
+
if any(arg not in allowed_types for arg in largs):
|
215 |
+
parser.print_help(sys.stderr)
|
216 |
+
return 0
|
217 |
+
if not largs:
|
218 |
+
largs = allowed_types
|
219 |
+
if not argns.json:
|
220 |
+
for arg in largs:
|
221 |
+
_print_list(arg)
|
222 |
+
else:
|
223 |
+
_print_list_as_json(largs)
|
224 |
+
return 0
|
225 |
+
|
226 |
+
# handle ``pygmentize -H``
|
227 |
+
if argns.H:
|
228 |
+
if not is_only_option('H'):
|
229 |
+
parser.print_help(sys.stderr)
|
230 |
+
return 2
|
231 |
+
what, name = argns.H
|
232 |
+
if what not in ('lexer', 'formatter', 'filter'):
|
233 |
+
parser.print_help(sys.stderr)
|
234 |
+
return 2
|
235 |
+
return _print_help(what, name)
|
236 |
+
|
237 |
+
# parse -O options
|
238 |
+
parsed_opts = _parse_options(argns.O or [])
|
239 |
+
|
240 |
+
# parse -P options
|
241 |
+
for p_opt in argns.P or []:
|
242 |
+
try:
|
243 |
+
name, value = p_opt.split('=', 1)
|
244 |
+
except ValueError:
|
245 |
+
parsed_opts[p_opt] = True
|
246 |
+
else:
|
247 |
+
parsed_opts[name] = value
|
248 |
+
|
249 |
+
# encodings
|
250 |
+
inencoding = parsed_opts.get('inencoding', parsed_opts.get('encoding'))
|
251 |
+
outencoding = parsed_opts.get('outencoding', parsed_opts.get('encoding'))
|
252 |
+
|
253 |
+
# handle ``pygmentize -N``
|
254 |
+
if argns.N:
|
255 |
+
lexer = find_lexer_class_for_filename(argns.N)
|
256 |
+
if lexer is None:
|
257 |
+
lexer = TextLexer
|
258 |
+
|
259 |
+
print(lexer.aliases[0])
|
260 |
+
return 0
|
261 |
+
|
262 |
+
# handle ``pygmentize -C``
|
263 |
+
if argns.C:
|
264 |
+
inp = sys.stdin.buffer.read()
|
265 |
+
try:
|
266 |
+
lexer = guess_lexer(inp, inencoding=inencoding)
|
267 |
+
except ClassNotFound:
|
268 |
+
lexer = TextLexer
|
269 |
+
|
270 |
+
print(lexer.aliases[0])
|
271 |
+
return 0
|
272 |
+
|
273 |
+
# handle ``pygmentize -S``
|
274 |
+
S_opt = argns.S
|
275 |
+
a_opt = argns.a
|
276 |
+
if S_opt is not None:
|
277 |
+
f_opt = argns.f
|
278 |
+
if not f_opt:
|
279 |
+
parser.print_help(sys.stderr)
|
280 |
+
return 2
|
281 |
+
if argns.l or argns.INPUTFILE:
|
282 |
+
parser.print_help(sys.stderr)
|
283 |
+
return 2
|
284 |
+
|
285 |
+
try:
|
286 |
+
parsed_opts['style'] = S_opt
|
287 |
+
fmter = get_formatter_by_name(f_opt, **parsed_opts)
|
288 |
+
except ClassNotFound as err:
|
289 |
+
print(err, file=sys.stderr)
|
290 |
+
return 1
|
291 |
+
|
292 |
+
print(fmter.get_style_defs(a_opt or ''))
|
293 |
+
return 0
|
294 |
+
|
295 |
+
# if no -S is given, -a is not allowed
|
296 |
+
if argns.a is not None:
|
297 |
+
parser.print_help(sys.stderr)
|
298 |
+
return 2
|
299 |
+
|
300 |
+
# parse -F options
|
301 |
+
F_opts = _parse_filters(argns.F or [])
|
302 |
+
|
303 |
+
# -x: allow custom (eXternal) lexers and formatters
|
304 |
+
allow_custom_lexer_formatter = bool(argns.x)
|
305 |
+
|
306 |
+
# select lexer
|
307 |
+
lexer = None
|
308 |
+
|
309 |
+
# given by name?
|
310 |
+
lexername = argns.l
|
311 |
+
if lexername:
|
312 |
+
# custom lexer, located relative to user's cwd
|
313 |
+
if allow_custom_lexer_formatter and '.py' in lexername:
|
314 |
+
try:
|
315 |
+
filename = None
|
316 |
+
name = None
|
317 |
+
if ':' in lexername:
|
318 |
+
filename, name = lexername.rsplit(':', 1)
|
319 |
+
|
320 |
+
if '.py' in name:
|
321 |
+
# This can happen on Windows: If the lexername is
|
322 |
+
# C:\lexer.py -- return to normal load path in that case
|
323 |
+
name = None
|
324 |
+
|
325 |
+
if filename and name:
|
326 |
+
lexer = load_lexer_from_file(filename, name,
|
327 |
+
**parsed_opts)
|
328 |
+
else:
|
329 |
+
lexer = load_lexer_from_file(lexername, **parsed_opts)
|
330 |
+
except ClassNotFound as err:
|
331 |
+
print('Error:', err, file=sys.stderr)
|
332 |
+
return 1
|
333 |
+
else:
|
334 |
+
try:
|
335 |
+
lexer = get_lexer_by_name(lexername, **parsed_opts)
|
336 |
+
except (OptionError, ClassNotFound) as err:
|
337 |
+
print('Error:', err, file=sys.stderr)
|
338 |
+
return 1
|
339 |
+
|
340 |
+
# read input code
|
341 |
+
code = None
|
342 |
+
|
343 |
+
if argns.INPUTFILE:
|
344 |
+
if argns.s:
|
345 |
+
print('Error: -s option not usable when input file specified',
|
346 |
+
file=sys.stderr)
|
347 |
+
return 2
|
348 |
+
|
349 |
+
infn = argns.INPUTFILE
|
350 |
+
try:
|
351 |
+
with open(infn, 'rb') as infp:
|
352 |
+
code = infp.read()
|
353 |
+
except Exception as err:
|
354 |
+
print('Error: cannot read infile:', err, file=sys.stderr)
|
355 |
+
return 1
|
356 |
+
if not inencoding:
|
357 |
+
code, inencoding = guess_decode(code)
|
358 |
+
|
359 |
+
# do we have to guess the lexer?
|
360 |
+
if not lexer:
|
361 |
+
try:
|
362 |
+
lexer = get_lexer_for_filename(infn, code, **parsed_opts)
|
363 |
+
except ClassNotFound as err:
|
364 |
+
if argns.g:
|
365 |
+
try:
|
366 |
+
lexer = guess_lexer(code, **parsed_opts)
|
367 |
+
except ClassNotFound:
|
368 |
+
lexer = TextLexer(**parsed_opts)
|
369 |
+
else:
|
370 |
+
print('Error:', err, file=sys.stderr)
|
371 |
+
return 1
|
372 |
+
except OptionError as err:
|
373 |
+
print('Error:', err, file=sys.stderr)
|
374 |
+
return 1
|
375 |
+
|
376 |
+
elif not argns.s: # treat stdin as full file (-s support is later)
|
377 |
+
# read code from terminal, always in binary mode since we want to
|
378 |
+
# decode ourselves and be tolerant with it
|
379 |
+
code = sys.stdin.buffer.read() # use .buffer to get a binary stream
|
380 |
+
if not inencoding:
|
381 |
+
code, inencoding = guess_decode_from_terminal(code, sys.stdin)
|
382 |
+
# else the lexer will do the decoding
|
383 |
+
if not lexer:
|
384 |
+
try:
|
385 |
+
lexer = guess_lexer(code, **parsed_opts)
|
386 |
+
except ClassNotFound:
|
387 |
+
lexer = TextLexer(**parsed_opts)
|
388 |
+
|
389 |
+
else: # -s option needs a lexer with -l
|
390 |
+
if not lexer:
|
391 |
+
print('Error: when using -s a lexer has to be selected with -l',
|
392 |
+
file=sys.stderr)
|
393 |
+
return 2
|
394 |
+
|
395 |
+
# process filters
|
396 |
+
for fname, fopts in F_opts:
|
397 |
+
try:
|
398 |
+
lexer.add_filter(fname, **fopts)
|
399 |
+
except ClassNotFound as err:
|
400 |
+
print('Error:', err, file=sys.stderr)
|
401 |
+
return 1
|
402 |
+
|
403 |
+
# select formatter
|
404 |
+
outfn = argns.o
|
405 |
+
fmter = argns.f
|
406 |
+
if fmter:
|
407 |
+
# custom formatter, located relative to user's cwd
|
408 |
+
if allow_custom_lexer_formatter and '.py' in fmter:
|
409 |
+
try:
|
410 |
+
filename = None
|
411 |
+
name = None
|
412 |
+
if ':' in fmter:
|
413 |
+
# Same logic as above for custom lexer
|
414 |
+
filename, name = fmter.rsplit(':', 1)
|
415 |
+
|
416 |
+
if '.py' in name:
|
417 |
+
name = None
|
418 |
+
|
419 |
+
if filename and name:
|
420 |
+
fmter = load_formatter_from_file(filename, name,
|
421 |
+
**parsed_opts)
|
422 |
+
else:
|
423 |
+
fmter = load_formatter_from_file(fmter, **parsed_opts)
|
424 |
+
except ClassNotFound as err:
|
425 |
+
print('Error:', err, file=sys.stderr)
|
426 |
+
return 1
|
427 |
+
else:
|
428 |
+
try:
|
429 |
+
fmter = get_formatter_by_name(fmter, **parsed_opts)
|
430 |
+
except (OptionError, ClassNotFound) as err:
|
431 |
+
print('Error:', err, file=sys.stderr)
|
432 |
+
return 1
|
433 |
+
|
434 |
+
if outfn:
|
435 |
+
if not fmter:
|
436 |
+
try:
|
437 |
+
fmter = get_formatter_for_filename(outfn, **parsed_opts)
|
438 |
+
except (OptionError, ClassNotFound) as err:
|
439 |
+
print('Error:', err, file=sys.stderr)
|
440 |
+
return 1
|
441 |
+
try:
|
442 |
+
outfile = open(outfn, 'wb')
|
443 |
+
except Exception as err:
|
444 |
+
print('Error: cannot open outfile:', err, file=sys.stderr)
|
445 |
+
return 1
|
446 |
+
else:
|
447 |
+
if not fmter:
|
448 |
+
if '256' in os.environ.get('TERM', ''):
|
449 |
+
fmter = Terminal256Formatter(**parsed_opts)
|
450 |
+
else:
|
451 |
+
fmter = TerminalFormatter(**parsed_opts)
|
452 |
+
outfile = sys.stdout.buffer
|
453 |
+
|
454 |
+
# determine output encoding if not explicitly selected
|
455 |
+
if not outencoding:
|
456 |
+
if outfn:
|
457 |
+
# output file? use lexer encoding for now (can still be None)
|
458 |
+
fmter.encoding = inencoding
|
459 |
+
else:
|
460 |
+
# else use terminal encoding
|
461 |
+
fmter.encoding = terminal_encoding(sys.stdout)
|
462 |
+
|
463 |
+
# provide coloring under Windows, if possible
|
464 |
+
if not outfn and sys.platform in ('win32', 'cygwin') and \
|
465 |
+
fmter.name in ('Terminal', 'Terminal256'): # pragma: no cover
|
466 |
+
# unfortunately colorama doesn't support binary streams on Py3
|
467 |
+
outfile = UnclosingTextIOWrapper(outfile, encoding=fmter.encoding)
|
468 |
+
fmter.encoding = None
|
469 |
+
try:
|
470 |
+
import pip._vendor.colorama.initialise as colorama_initialise
|
471 |
+
except ImportError:
|
472 |
+
pass
|
473 |
+
else:
|
474 |
+
outfile = colorama_initialise.wrap_stream(
|
475 |
+
outfile, convert=None, strip=None, autoreset=False, wrap=True)
|
476 |
+
|
477 |
+
# When using the LaTeX formatter and the option `escapeinside` is
|
478 |
+
# specified, we need a special lexer which collects escaped text
|
479 |
+
# before running the chosen language lexer.
|
480 |
+
escapeinside = parsed_opts.get('escapeinside', '')
|
481 |
+
if len(escapeinside) == 2 and isinstance(fmter, LatexFormatter):
|
482 |
+
left = escapeinside[0]
|
483 |
+
right = escapeinside[1]
|
484 |
+
lexer = LatexEmbeddedLexer(left, right, lexer)
|
485 |
+
|
486 |
+
# ... and do it!
|
487 |
+
if not argns.s:
|
488 |
+
# process whole input as per normal...
|
489 |
+
try:
|
490 |
+
highlight(code, lexer, fmter, outfile)
|
491 |
+
finally:
|
492 |
+
if outfn:
|
493 |
+
outfile.close()
|
494 |
+
return 0
|
495 |
+
else:
|
496 |
+
# line by line processing of stdin (eg: for 'tail -f')...
|
497 |
+
try:
|
498 |
+
while 1:
|
499 |
+
line = sys.stdin.buffer.readline()
|
500 |
+
if not line:
|
501 |
+
break
|
502 |
+
if not inencoding:
|
503 |
+
line = guess_decode_from_terminal(line, sys.stdin)[0]
|
504 |
+
highlight(line, lexer, fmter, outfile)
|
505 |
+
if hasattr(outfile, 'flush'):
|
506 |
+
outfile.flush()
|
507 |
+
return 0
|
508 |
+
except KeyboardInterrupt: # pragma: no cover
|
509 |
+
return 0
|
510 |
+
finally:
|
511 |
+
if outfn:
|
512 |
+
outfile.close()
|
513 |
+
|
514 |
+
|
515 |
+
class HelpFormatter(argparse.HelpFormatter):
|
516 |
+
def __init__(self, prog, indent_increment=2, max_help_position=16, width=None):
|
517 |
+
if width is None:
|
518 |
+
try:
|
519 |
+
width = shutil.get_terminal_size().columns - 2
|
520 |
+
except Exception:
|
521 |
+
pass
|
522 |
+
argparse.HelpFormatter.__init__(self, prog, indent_increment,
|
523 |
+
max_help_position, width)
|
524 |
+
|
525 |
+
|
526 |
+
def main(args=sys.argv):
|
527 |
+
"""
|
528 |
+
Main command line entry point.
|
529 |
+
"""
|
530 |
+
desc = "Highlight an input file and write the result to an output file."
|
531 |
+
parser = argparse.ArgumentParser(description=desc, add_help=False,
|
532 |
+
formatter_class=HelpFormatter)
|
533 |
+
|
534 |
+
operation = parser.add_argument_group('Main operation')
|
535 |
+
lexersel = operation.add_mutually_exclusive_group()
|
536 |
+
lexersel.add_argument(
|
537 |
+
'-l', metavar='LEXER',
|
538 |
+
help='Specify the lexer to use. (Query names with -L.) If not '
|
539 |
+
'given and -g is not present, the lexer is guessed from the filename.')
|
540 |
+
lexersel.add_argument(
|
541 |
+
'-g', action='store_true',
|
542 |
+
help='Guess the lexer from the file contents, or pass through '
|
543 |
+
'as plain text if nothing can be guessed.')
|
544 |
+
operation.add_argument(
|
545 |
+
'-F', metavar='FILTER[:options]', action='append',
|
546 |
+
help='Add a filter to the token stream. (Query names with -L.) '
|
547 |
+
'Filter options are given after a colon if necessary.')
|
548 |
+
operation.add_argument(
|
549 |
+
'-f', metavar='FORMATTER',
|
550 |
+
help='Specify the formatter to use. (Query names with -L.) '
|
551 |
+
'If not given, the formatter is guessed from the output filename, '
|
552 |
+
'and defaults to the terminal formatter if the output is to the '
|
553 |
+
'terminal or an unknown file extension.')
|
554 |
+
operation.add_argument(
|
555 |
+
'-O', metavar='OPTION=value[,OPTION=value,...]', action='append',
|
556 |
+
help='Give options to the lexer and formatter as a comma-separated '
|
557 |
+
'list of key-value pairs. '
|
558 |
+
'Example: `-O bg=light,python=cool`.')
|
559 |
+
operation.add_argument(
|
560 |
+
'-P', metavar='OPTION=value', action='append',
|
561 |
+
help='Give a single option to the lexer and formatter - with this '
|
562 |
+
'you can pass options whose value contains commas and equal signs. '
|
563 |
+
'Example: `-P "heading=Pygments, the Python highlighter"`.')
|
564 |
+
operation.add_argument(
|
565 |
+
'-o', metavar='OUTPUTFILE',
|
566 |
+
help='Where to write the output. Defaults to standard output.')
|
567 |
+
|
568 |
+
operation.add_argument(
|
569 |
+
'INPUTFILE', nargs='?',
|
570 |
+
help='Where to read the input. Defaults to standard input.')
|
571 |
+
|
572 |
+
flags = parser.add_argument_group('Operation flags')
|
573 |
+
flags.add_argument(
|
574 |
+
'-v', action='store_true',
|
575 |
+
help='Print a detailed traceback on unhandled exceptions, which '
|
576 |
+
'is useful for debugging and bug reports.')
|
577 |
+
flags.add_argument(
|
578 |
+
'-s', action='store_true',
|
579 |
+
help='Process lines one at a time until EOF, rather than waiting to '
|
580 |
+
'process the entire file. This only works for stdin, only for lexers '
|
581 |
+
'with no line-spanning constructs, and is intended for streaming '
|
582 |
+
'input such as you get from `tail -f`. '
|
583 |
+
'Example usage: `tail -f sql.log | pygmentize -s -l sql`.')
|
584 |
+
flags.add_argument(
|
585 |
+
'-x', action='store_true',
|
586 |
+
help='Allow custom lexers and formatters to be loaded from a .py file '
|
587 |
+
'relative to the current working directory. For example, '
|
588 |
+
'`-l ./customlexer.py -x`. By default, this option expects a file '
|
589 |
+
'with a class named CustomLexer or CustomFormatter; you can also '
|
590 |
+
'specify your own class name with a colon (`-l ./lexer.py:MyLexer`). '
|
591 |
+
'Users should be very careful not to use this option with untrusted '
|
592 |
+
'files, because it will import and run them.')
|
593 |
+
flags.add_argument('--json', help='Output as JSON. This can '
|
594 |
+
'be only used in conjunction with -L.',
|
595 |
+
default=False,
|
596 |
+
action='store_true')
|
597 |
+
|
598 |
+
special_modes_group = parser.add_argument_group(
|
599 |
+
'Special modes - do not do any highlighting')
|
600 |
+
special_modes = special_modes_group.add_mutually_exclusive_group()
|
601 |
+
special_modes.add_argument(
|
602 |
+
'-S', metavar='STYLE -f formatter',
|
603 |
+
help='Print style definitions for STYLE for a formatter '
|
604 |
+
'given with -f. The argument given by -a is formatter '
|
605 |
+
'dependent.')
|
606 |
+
special_modes.add_argument(
|
607 |
+
'-L', nargs='*', metavar='WHAT',
|
608 |
+
help='List lexers, formatters, styles or filters -- '
|
609 |
+
'give additional arguments for the thing(s) you want to list '
|
610 |
+
'(e.g. "styles"), or omit them to list everything.')
|
611 |
+
special_modes.add_argument(
|
612 |
+
'-N', metavar='FILENAME',
|
613 |
+
help='Guess and print out a lexer name based solely on the given '
|
614 |
+
'filename. Does not take input or highlight anything. If no specific '
|
615 |
+
'lexer can be determined, "text" is printed.')
|
616 |
+
special_modes.add_argument(
|
617 |
+
'-C', action='store_true',
|
618 |
+
help='Like -N, but print out a lexer name based solely on '
|
619 |
+
'a given content from standard input.')
|
620 |
+
special_modes.add_argument(
|
621 |
+
'-H', action='store', nargs=2, metavar=('NAME', 'TYPE'),
|
622 |
+
help='Print detailed help for the object <name> of type <type>, '
|
623 |
+
'where <type> is one of "lexer", "formatter" or "filter".')
|
624 |
+
special_modes.add_argument(
|
625 |
+
'-V', action='store_true',
|
626 |
+
help='Print the package version.')
|
627 |
+
special_modes.add_argument(
|
628 |
+
'-h', '--help', action='store_true',
|
629 |
+
help='Print this help.')
|
630 |
+
special_modes_group.add_argument(
|
631 |
+
'-a', metavar='ARG',
|
632 |
+
help='Formatter-specific additional argument for the -S (print '
|
633 |
+
'style sheet) mode.')
|
634 |
+
|
635 |
+
argns = parser.parse_args(args[1:])
|
636 |
+
|
637 |
+
try:
|
638 |
+
return main_inner(parser, argns)
|
639 |
+
except Exception:
|
640 |
+
if argns.v:
|
641 |
+
print(file=sys.stderr)
|
642 |
+
print('*' * 65, file=sys.stderr)
|
643 |
+
print('An unhandled exception occurred while highlighting.',
|
644 |
+
file=sys.stderr)
|
645 |
+
print('Please report the whole traceback to the issue tracker at',
|
646 |
+
file=sys.stderr)
|
647 |
+
print('<https://github.com/pygments/pygments/issues>.',
|
648 |
+
file=sys.stderr)
|
649 |
+
print('*' * 65, file=sys.stderr)
|
650 |
+
print(file=sys.stderr)
|
651 |
+
raise
|
652 |
+
import traceback
|
653 |
+
info = traceback.format_exception(*sys.exc_info())
|
654 |
+
msg = info[-1].strip()
|
655 |
+
if len(info) >= 3:
|
656 |
+
# extract relevant file and position info
|
657 |
+
msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
|
658 |
+
print(file=sys.stderr)
|
659 |
+
print('*** Error while highlighting:', file=sys.stderr)
|
660 |
+
print(msg, file=sys.stderr)
|
661 |
+
print('*** If this is a bug you want to report, please rerun with -v.',
|
662 |
+
file=sys.stderr)
|
663 |
+
return 1
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/console.py
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
pygments.console
|
3 |
+
~~~~~~~~~~~~~~~~
|
4 |
+
|
5 |
+
Format colored console output.
|
6 |
+
|
7 |
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
|
8 |
+
:license: BSD, see LICENSE for details.
|
9 |
+
"""
|
10 |
+
|
11 |
+
esc = "\x1b["
|
12 |
+
|
13 |
+
codes = {}
|
14 |
+
codes[""] = ""
|
15 |
+
codes["reset"] = esc + "39;49;00m"
|
16 |
+
|
17 |
+
codes["bold"] = esc + "01m"
|
18 |
+
codes["faint"] = esc + "02m"
|
19 |
+
codes["standout"] = esc + "03m"
|
20 |
+
codes["underline"] = esc + "04m"
|
21 |
+
codes["blink"] = esc + "05m"
|
22 |
+
codes["overline"] = esc + "06m"
|
23 |
+
|
24 |
+
dark_colors = ["black", "red", "green", "yellow", "blue",
|
25 |
+
"magenta", "cyan", "gray"]
|
26 |
+
light_colors = ["brightblack", "brightred", "brightgreen", "brightyellow", "brightblue",
|
27 |
+
"brightmagenta", "brightcyan", "white"]
|
28 |
+
|
29 |
+
x = 30
|
30 |
+
for d, l in zip(dark_colors, light_colors):
|
31 |
+
codes[d] = esc + "%im" % x
|
32 |
+
codes[l] = esc + "%im" % (60 + x)
|
33 |
+
x += 1
|
34 |
+
|
35 |
+
del d, l, x
|
36 |
+
|
37 |
+
codes["white"] = codes["bold"]
|
38 |
+
|
39 |
+
|
40 |
+
def reset_color():
|
41 |
+
return codes["reset"]
|
42 |
+
|
43 |
+
|
44 |
+
def colorize(color_key, text):
|
45 |
+
return codes[color_key] + text + codes["reset"]
|
46 |
+
|
47 |
+
|
48 |
+
def ansiformat(attr, text):
|
49 |
+
"""
|
50 |
+
Format ``text`` with a color and/or some attributes::
|
51 |
+
|
52 |
+
color normal color
|
53 |
+
*color* bold color
|
54 |
+
_color_ underlined color
|
55 |
+
+color+ blinking color
|
56 |
+
"""
|
57 |
+
result = []
|
58 |
+
if attr[:1] == attr[-1:] == '+':
|
59 |
+
result.append(codes['blink'])
|
60 |
+
attr = attr[1:-1]
|
61 |
+
if attr[:1] == attr[-1:] == '*':
|
62 |
+
result.append(codes['bold'])
|
63 |
+
attr = attr[1:-1]
|
64 |
+
if attr[:1] == attr[-1:] == '_':
|
65 |
+
result.append(codes['underline'])
|
66 |
+
attr = attr[1:-1]
|
67 |
+
result.append(codes[attr])
|
68 |
+
result.append(text)
|
69 |
+
result.append(codes['reset'])
|
70 |
+
return ''.join(result)
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/filters/__init__.py
ADDED
@@ -0,0 +1,937 @@
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
pygments.filters
|
3 |
+
~~~~~~~~~~~~~~~~
|
4 |
+
|
5 |
+
Module containing filter lookup functions and default
|
6 |
+
filters.
|
7 |
+
|
8 |
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
|
9 |
+
:license: BSD, see LICENSE for details.
|
10 |
+
"""
|
11 |
+
|
12 |
+
import re
|
13 |
+
|
14 |
+
from pip._vendor.pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \
|
15 |
+
string_to_tokentype
|
16 |
+
from pip._vendor.pygments.filter import Filter
|
17 |
+
from pip._vendor.pygments.util import get_list_opt, get_int_opt, get_bool_opt, \
|
18 |
+
get_choice_opt, ClassNotFound, OptionError
|
19 |
+
from pip._vendor.pygments.plugin import find_plugin_filters
|
20 |
+
|
21 |
+
|
22 |
+
def find_filter_class(filtername):
|
23 |
+
"""Lookup a filter by name. Return None if not found."""
|
24 |
+
if filtername in FILTERS:
|
25 |
+
return FILTERS[filtername]
|
26 |
+
for name, cls in find_plugin_filters():
|
27 |
+
if name == filtername:
|
28 |
+
return cls
|
29 |
+
return None
|
30 |
+
|
31 |
+
|
32 |
+
def get_filter_by_name(filtername, **options):
|
33 |
+
"""Return an instantiated filter.
|
34 |
+
|
35 |
+
Options are passed to the filter initializer if wanted.
|
36 |
+
Raise a ClassNotFound if not found.
|
37 |
+
"""
|
38 |
+
cls = find_filter_class(filtername)
|
39 |
+
if cls:
|
40 |
+
return cls(**options)
|
41 |
+
else:
|
42 |
+
raise ClassNotFound('filter %r not found' % filtername)
|
43 |
+
|
44 |
+
|
45 |
+
def get_all_filters():
|
46 |
+
"""Return a generator of all filter names."""
|
47 |
+
yield from FILTERS
|
48 |
+
for name, _ in find_plugin_filters():
|
49 |
+
yield name
|
50 |
+
|
51 |
+
|
52 |
+
def _replace_special(ttype, value, regex, specialttype,
|
53 |
+
replacefunc=lambda x: x):
|
54 |
+
last = 0
|
55 |
+
for match in regex.finditer(value):
|
56 |
+
start, end = match.start(), match.end()
|
57 |
+
if start != last:
|
58 |
+
yield ttype, value[last:start]
|
59 |
+
yield specialttype, replacefunc(value[start:end])
|
60 |
+
last = end
|
61 |
+
if last != len(value):
|
62 |
+
yield ttype, value[last:]
|
63 |
+
|
64 |
+
|
65 |
+
class CodeTagFilter(Filter):
|
66 |
+
"""Highlight special code tags in comments and docstrings.
|
67 |
+
|
68 |
+
Options accepted:
|
69 |
+
|
70 |
+
`codetags` : list of strings
|
71 |
+
A list of strings that are flagged as code tags. The default is to
|
72 |
+
highlight ``XXX``, ``TODO``, ``BUG`` and ``NOTE``.
|
73 |
+
"""
|
74 |
+
|
75 |
+
def __init__(self, **options):
|
76 |
+
Filter.__init__(self, **options)
|
77 |
+
tags = get_list_opt(options, 'codetags',
|
78 |
+
['XXX', 'TODO', 'BUG', 'NOTE'])
|
79 |
+
self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
|
80 |
+
re.escape(tag) for tag in tags if tag
|
81 |
+
]))
|
82 |
+
|
83 |
+
def filter(self, lexer, stream):
|
84 |
+
regex = self.tag_re
|
85 |
+
for ttype, value in stream:
|
86 |
+
if ttype in String.Doc or \
|
87 |
+
ttype in Comment and \
|
88 |
+
ttype not in Comment.Preproc:
|
89 |
+
yield from _replace_special(ttype, value, regex, Comment.Special)
|
90 |
+
else:
|
91 |
+
yield ttype, value
|
92 |
+
|
93 |
+
|
94 |
+
class SymbolFilter(Filter):
|
95 |
+
"""Convert mathematical symbols such as \\<longrightarrow> in Isabelle
|
96 |
+
or \\longrightarrow in LaTeX into Unicode characters.
|
97 |
+
|
98 |
+
This is mostly useful for HTML or console output when you want to
|
99 |
+
approximate the source rendering you'd see in an IDE.
|
100 |
+
|
101 |
+
Options accepted:
|
102 |
+
|
103 |
+
`lang` : string
|
104 |
+
The symbol language. Must be one of ``'isabelle'`` or
|
105 |
+
``'latex'``. The default is ``'isabelle'``.
|
106 |
+
"""
|
107 |
+
|
108 |
+
latex_symbols = {
|
109 |
+
'\\alpha' : '\U000003b1',
|
110 |
+
'\\beta' : '\U000003b2',
|
111 |
+
'\\gamma' : '\U000003b3',
|
112 |
+
'\\delta' : '\U000003b4',
|
113 |
+
'\\varepsilon' : '\U000003b5',
|
114 |
+
'\\zeta' : '\U000003b6',
|
115 |
+
'\\eta' : '\U000003b7',
|
116 |
+
'\\vartheta' : '\U000003b8',
|
117 |
+
'\\iota' : '\U000003b9',
|
118 |
+
'\\kappa' : '\U000003ba',
|
119 |
+
'\\lambda' : '\U000003bb',
|
120 |
+
'\\mu' : '\U000003bc',
|
121 |
+
'\\nu' : '\U000003bd',
|
122 |
+
'\\xi' : '\U000003be',
|
123 |
+
'\\pi' : '\U000003c0',
|
124 |
+
'\\varrho' : '\U000003c1',
|
125 |
+
'\\sigma' : '\U000003c3',
|
126 |
+
'\\tau' : '\U000003c4',
|
127 |
+
'\\upsilon' : '\U000003c5',
|
128 |
+
'\\varphi' : '\U000003c6',
|
129 |
+
'\\chi' : '\U000003c7',
|
130 |
+
'\\psi' : '\U000003c8',
|
131 |
+
'\\omega' : '\U000003c9',
|
132 |
+
'\\Gamma' : '\U00000393',
|
133 |
+
'\\Delta' : '\U00000394',
|
134 |
+
'\\Theta' : '\U00000398',
|
135 |
+
'\\Lambda' : '\U0000039b',
|
136 |
+
'\\Xi' : '\U0000039e',
|
137 |
+
'\\Pi' : '\U000003a0',
|
138 |
+
'\\Sigma' : '\U000003a3',
|
139 |
+
'\\Upsilon' : '\U000003a5',
|
140 |
+
'\\Phi' : '\U000003a6',
|
141 |
+
'\\Psi' : '\U000003a8',
|
142 |
+
'\\Omega' : '\U000003a9',
|
143 |
+
'\\leftarrow' : '\U00002190',
|
144 |
+
'\\longleftarrow' : '\U000027f5',
|
145 |
+
'\\rightarrow' : '\U00002192',
|
146 |
+
'\\longrightarrow' : '\U000027f6',
|
147 |
+
'\\Leftarrow' : '\U000021d0',
|
148 |
+
'\\Longleftarrow' : '\U000027f8',
|
149 |
+
'\\Rightarrow' : '\U000021d2',
|
150 |
+
'\\Longrightarrow' : '\U000027f9',
|
151 |
+
'\\leftrightarrow' : '\U00002194',
|
152 |
+
'\\longleftrightarrow' : '\U000027f7',
|
153 |
+
'\\Leftrightarrow' : '\U000021d4',
|
154 |
+
'\\Longleftrightarrow' : '\U000027fa',
|
155 |
+
'\\mapsto' : '\U000021a6',
|
156 |
+
'\\longmapsto' : '\U000027fc',
|
157 |
+
'\\relbar' : '\U00002500',
|
158 |
+
'\\Relbar' : '\U00002550',
|
159 |
+
'\\hookleftarrow' : '\U000021a9',
|
160 |
+
'\\hookrightarrow' : '\U000021aa',
|
161 |
+
'\\leftharpoondown' : '\U000021bd',
|
162 |
+
'\\rightharpoondown' : '\U000021c1',
|
163 |
+
'\\leftharpoonup' : '\U000021bc',
|
164 |
+
'\\rightharpoonup' : '\U000021c0',
|
165 |
+
'\\rightleftharpoons' : '\U000021cc',
|
166 |
+
'\\leadsto' : '\U0000219d',
|
167 |
+
'\\downharpoonleft' : '\U000021c3',
|
168 |
+
'\\downharpoonright' : '\U000021c2',
|
169 |
+
'\\upharpoonleft' : '\U000021bf',
|
170 |
+
'\\upharpoonright' : '\U000021be',
|
171 |
+
'\\restriction' : '\U000021be',
|
172 |
+
'\\uparrow' : '\U00002191',
|
173 |
+
'\\Uparrow' : '\U000021d1',
|
174 |
+
'\\downarrow' : '\U00002193',
|
175 |
+
'\\Downarrow' : '\U000021d3',
|
176 |
+
'\\updownarrow' : '\U00002195',
|
177 |
+
'\\Updownarrow' : '\U000021d5',
|
178 |
+
'\\langle' : '\U000027e8',
|
179 |
+
'\\rangle' : '\U000027e9',
|
180 |
+
'\\lceil' : '\U00002308',
|
181 |
+
'\\rceil' : '\U00002309',
|
182 |
+
'\\lfloor' : '\U0000230a',
|
183 |
+
'\\rfloor' : '\U0000230b',
|
184 |
+
'\\flqq' : '\U000000ab',
|
185 |
+
'\\frqq' : '\U000000bb',
|
186 |
+
'\\bot' : '\U000022a5',
|
187 |
+
'\\top' : '\U000022a4',
|
188 |
+
'\\wedge' : '\U00002227',
|
189 |
+
'\\bigwedge' : '\U000022c0',
|
190 |
+
'\\vee' : '\U00002228',
|
191 |
+
'\\bigvee' : '\U000022c1',
|
192 |
+
'\\forall' : '\U00002200',
|
193 |
+
'\\exists' : '\U00002203',
|
194 |
+
'\\nexists' : '\U00002204',
|
195 |
+
'\\neg' : '\U000000ac',
|
196 |
+
'\\Box' : '\U000025a1',
|
197 |
+
'\\Diamond' : '\U000025c7',
|
198 |
+
'\\vdash' : '\U000022a2',
|
199 |
+
'\\models' : '\U000022a8',
|
200 |
+
'\\dashv' : '\U000022a3',
|
201 |
+
'\\surd' : '\U0000221a',
|
202 |
+
'\\le' : '\U00002264',
|
203 |
+
'\\ge' : '\U00002265',
|
204 |
+
'\\ll' : '\U0000226a',
|
205 |
+
'\\gg' : '\U0000226b',
|
206 |
+
'\\lesssim' : '\U00002272',
|
207 |
+
'\\gtrsim' : '\U00002273',
|
208 |
+
'\\lessapprox' : '\U00002a85',
|
209 |
+
'\\gtrapprox' : '\U00002a86',
|
210 |
+
'\\in' : '\U00002208',
|
211 |
+
'\\notin' : '\U00002209',
|
212 |
+
'\\subset' : '\U00002282',
|
213 |
+
'\\supset' : '\U00002283',
|
214 |
+
'\\subseteq' : '\U00002286',
|
215 |
+
'\\supseteq' : '\U00002287',
|
216 |
+
'\\sqsubset' : '\U0000228f',
|
217 |
+
'\\sqsupset' : '\U00002290',
|
218 |
+
'\\sqsubseteq' : '\U00002291',
|
219 |
+
'\\sqsupseteq' : '\U00002292',
|
220 |
+
'\\cap' : '\U00002229',
|
221 |
+
'\\bigcap' : '\U000022c2',
|
222 |
+
'\\cup' : '\U0000222a',
|
223 |
+
'\\bigcup' : '\U000022c3',
|
224 |
+
'\\sqcup' : '\U00002294',
|
225 |
+
'\\bigsqcup' : '\U00002a06',
|
226 |
+
'\\sqcap' : '\U00002293',
|
227 |
+
'\\Bigsqcap' : '\U00002a05',
|
228 |
+
'\\setminus' : '\U00002216',
|
229 |
+
'\\propto' : '\U0000221d',
|
230 |
+
'\\uplus' : '\U0000228e',
|
231 |
+
'\\bigplus' : '\U00002a04',
|
232 |
+
'\\sim' : '\U0000223c',
|
233 |
+
'\\doteq' : '\U00002250',
|
234 |
+
'\\simeq' : '\U00002243',
|
235 |
+
'\\approx' : '\U00002248',
|
236 |
+
'\\asymp' : '\U0000224d',
|
237 |
+
'\\cong' : '\U00002245',
|
238 |
+
'\\equiv' : '\U00002261',
|
239 |
+
'\\Join' : '\U000022c8',
|
240 |
+
'\\bowtie' : '\U00002a1d',
|
241 |
+
'\\prec' : '\U0000227a',
|
242 |
+
'\\succ' : '\U0000227b',
|
243 |
+
'\\preceq' : '\U0000227c',
|
244 |
+
'\\succeq' : '\U0000227d',
|
245 |
+
'\\parallel' : '\U00002225',
|
246 |
+
'\\mid' : '\U000000a6',
|
247 |
+
'\\pm' : '\U000000b1',
|
248 |
+
'\\mp' : '\U00002213',
|
249 |
+
'\\times' : '\U000000d7',
|
250 |
+
'\\div' : '\U000000f7',
|
251 |
+
'\\cdot' : '\U000022c5',
|
252 |
+
'\\star' : '\U000022c6',
|
253 |
+
'\\circ' : '\U00002218',
|
254 |
+
'\\dagger' : '\U00002020',
|
255 |
+
'\\ddagger' : '\U00002021',
|
256 |
+
'\\lhd' : '\U000022b2',
|
257 |
+
'\\rhd' : '\U000022b3',
|
258 |
+
'\\unlhd' : '\U000022b4',
|
259 |
+
'\\unrhd' : '\U000022b5',
|
260 |
+
'\\triangleleft' : '\U000025c3',
|
261 |
+
'\\triangleright' : '\U000025b9',
|
262 |
+
'\\triangle' : '\U000025b3',
|
263 |
+
'\\triangleq' : '\U0000225c',
|
264 |
+
'\\oplus' : '\U00002295',
|
265 |
+
'\\bigoplus' : '\U00002a01',
|
266 |
+
'\\otimes' : '\U00002297',
|
267 |
+
'\\bigotimes' : '\U00002a02',
|
268 |
+
'\\odot' : '\U00002299',
|
269 |
+
'\\bigodot' : '\U00002a00',
|
270 |
+
'\\ominus' : '\U00002296',
|
271 |
+
'\\oslash' : '\U00002298',
|
272 |
+
'\\dots' : '\U00002026',
|
273 |
+
'\\cdots' : '\U000022ef',
|
274 |
+
'\\sum' : '\U00002211',
|
275 |
+
'\\prod' : '\U0000220f',
|
276 |
+
'\\coprod' : '\U00002210',
|
277 |
+
'\\infty' : '\U0000221e',
|
278 |
+
'\\int' : '\U0000222b',
|
279 |
+
'\\oint' : '\U0000222e',
|
280 |
+
'\\clubsuit' : '\U00002663',
|
281 |
+
'\\diamondsuit' : '\U00002662',
|
282 |
+
'\\heartsuit' : '\U00002661',
|
283 |
+
'\\spadesuit' : '\U00002660',
|
284 |
+
'\\aleph' : '\U00002135',
|
285 |
+
'\\emptyset' : '\U00002205',
|
286 |
+
'\\nabla' : '\U00002207',
|
287 |
+
'\\partial' : '\U00002202',
|
288 |
+
'\\flat' : '\U0000266d',
|
289 |
+
'\\natural' : '\U0000266e',
|
290 |
+
'\\sharp' : '\U0000266f',
|
291 |
+
'\\angle' : '\U00002220',
|
292 |
+
'\\copyright' : '\U000000a9',
|
293 |
+
'\\textregistered' : '\U000000ae',
|
294 |
+
'\\textonequarter' : '\U000000bc',
|
295 |
+
'\\textonehalf' : '\U000000bd',
|
296 |
+
'\\textthreequarters' : '\U000000be',
|
297 |
+
'\\textordfeminine' : '\U000000aa',
|
298 |
+
'\\textordmasculine' : '\U000000ba',
|
299 |
+
'\\euro' : '\U000020ac',
|
300 |
+
'\\pounds' : '\U000000a3',
|
301 |
+
'\\yen' : '\U000000a5',
|
302 |
+
'\\textcent' : '\U000000a2',
|
303 |
+
'\\textcurrency' : '\U000000a4',
|
304 |
+
'\\textdegree' : '\U000000b0',
|
305 |
+
}
|
306 |
+
|
307 |
+
isabelle_symbols = {
|
308 |
+
'\\<zero>' : '\U0001d7ec',
|
309 |
+
'\\<one>' : '\U0001d7ed',
|
310 |
+
'\\<two>' : '\U0001d7ee',
|
311 |
+
'\\<three>' : '\U0001d7ef',
|
312 |
+
'\\<four>' : '\U0001d7f0',
|
313 |
+
'\\<five>' : '\U0001d7f1',
|
314 |
+
'\\<six>' : '\U0001d7f2',
|
315 |
+
'\\<seven>' : '\U0001d7f3',
|
316 |
+
'\\<eight>' : '\U0001d7f4',
|
317 |
+
'\\<nine>' : '\U0001d7f5',
|
318 |
+
'\\<A>' : '\U0001d49c',
|
319 |
+
'\\<B>' : '\U0000212c',
|
320 |
+
'\\<C>' : '\U0001d49e',
|
321 |
+
'\\<D>' : '\U0001d49f',
|
322 |
+
'\\<E>' : '\U00002130',
|
323 |
+
'\\<F>' : '\U00002131',
|
324 |
+
'\\<G>' : '\U0001d4a2',
|
325 |
+
'\\<H>' : '\U0000210b',
|
326 |
+
'\\<I>' : '\U00002110',
|
327 |
+
'\\<J>' : '\U0001d4a5',
|
328 |
+
'\\<K>' : '\U0001d4a6',
|
329 |
+
'\\<L>' : '\U00002112',
|
330 |
+
'\\<M>' : '\U00002133',
|
331 |
+
'\\<N>' : '\U0001d4a9',
|
332 |
+
'\\<O>' : '\U0001d4aa',
|
333 |
+
'\\<P>' : '\U0001d4ab',
|
334 |
+
'\\<Q>' : '\U0001d4ac',
|
335 |
+
'\\<R>' : '\U0000211b',
|
336 |
+
'\\<S>' : '\U0001d4ae',
|
337 |
+
'\\<T>' : '\U0001d4af',
|
338 |
+
'\\<U>' : '\U0001d4b0',
|
339 |
+
'\\<V>' : '\U0001d4b1',
|
340 |
+
'\\<W>' : '\U0001d4b2',
|
341 |
+
'\\<X>' : '\U0001d4b3',
|
342 |
+
'\\<Y>' : '\U0001d4b4',
|
343 |
+
'\\<Z>' : '\U0001d4b5',
|
344 |
+
'\\<a>' : '\U0001d5ba',
|
345 |
+
'\\<b>' : '\U0001d5bb',
|
346 |
+
'\\<c>' : '\U0001d5bc',
|
347 |
+
'\\<d>' : '\U0001d5bd',
|
348 |
+
'\\<e>' : '\U0001d5be',
|
349 |
+
'\\<f>' : '\U0001d5bf',
|
350 |
+
'\\<g>' : '\U0001d5c0',
|
351 |
+
'\\<h>' : '\U0001d5c1',
|
352 |
+
'\\<i>' : '\U0001d5c2',
|
353 |
+
'\\<j>' : '\U0001d5c3',
|
354 |
+
'\\<k>' : '\U0001d5c4',
|
355 |
+
'\\<l>' : '\U0001d5c5',
|
356 |
+
'\\<m>' : '\U0001d5c6',
|
357 |
+
'\\<n>' : '\U0001d5c7',
|
358 |
+
'\\<o>' : '\U0001d5c8',
|
359 |
+
'\\<p>' : '\U0001d5c9',
|
360 |
+
'\\<q>' : '\U0001d5ca',
|
361 |
+
'\\<r>' : '\U0001d5cb',
|
362 |
+
'\\<s>' : '\U0001d5cc',
|
363 |
+
'\\<t>' : '\U0001d5cd',
|
364 |
+
'\\<u>' : '\U0001d5ce',
|
365 |
+
'\\<v>' : '\U0001d5cf',
|
366 |
+
'\\<w>' : '\U0001d5d0',
|
367 |
+
'\\<x>' : '\U0001d5d1',
|
368 |
+
'\\<y>' : '\U0001d5d2',
|
369 |
+
'\\<z>' : '\U0001d5d3',
|
370 |
+
'\\<AA>' : '\U0001d504',
|
371 |
+
'\\<BB>' : '\U0001d505',
|
372 |
+
'\\<CC>' : '\U0000212d',
|
373 |
+
'\\<DD>' : '\U0001d507',
|
374 |
+
'\\<EE>' : '\U0001d508',
|
375 |
+
'\\<FF>' : '\U0001d509',
|
376 |
+
'\\<GG>' : '\U0001d50a',
|
377 |
+
'\\<HH>' : '\U0000210c',
|
378 |
+
'\\<II>' : '\U00002111',
|
379 |
+
'\\<JJ>' : '\U0001d50d',
|
380 |
+
'\\<KK>' : '\U0001d50e',
|
381 |
+
'\\<LL>' : '\U0001d50f',
|
382 |
+
'\\<MM>' : '\U0001d510',
|
383 |
+
'\\<NN>' : '\U0001d511',
|
384 |
+
'\\<OO>' : '\U0001d512',
|
385 |
+
'\\<PP>' : '\U0001d513',
|
386 |
+
'\\<QQ>' : '\U0001d514',
|
387 |
+
'\\<RR>' : '\U0000211c',
|
388 |
+
'\\<SS>' : '\U0001d516',
|
389 |
+
'\\<TT>' : '\U0001d517',
|
390 |
+
'\\<UU>' : '\U0001d518',
|
391 |
+
'\\<VV>' : '\U0001d519',
|
392 |
+
'\\<WW>' : '\U0001d51a',
|
393 |
+
'\\<XX>' : '\U0001d51b',
|
394 |
+
'\\<YY>' : '\U0001d51c',
|
395 |
+
'\\<ZZ>' : '\U00002128',
|
396 |
+
'\\<aa>' : '\U0001d51e',
|
397 |
+
'\\<bb>' : '\U0001d51f',
|
398 |
+
'\\<cc>' : '\U0001d520',
|
399 |
+
'\\<dd>' : '\U0001d521',
|
400 |
+
'\\<ee>' : '\U0001d522',
|
401 |
+
'\\<ff>' : '\U0001d523',
|
402 |
+
'\\<gg>' : '\U0001d524',
|
403 |
+
'\\<hh>' : '\U0001d525',
|
404 |
+
'\\<ii>' : '\U0001d526',
|
405 |
+
'\\<jj>' : '\U0001d527',
|
406 |
+
'\\<kk>' : '\U0001d528',
|
407 |
+
'\\<ll>' : '\U0001d529',
|
408 |
+
'\\<mm>' : '\U0001d52a',
|
409 |
+
'\\<nn>' : '\U0001d52b',
|
410 |
+
'\\<oo>' : '\U0001d52c',
|
411 |
+
'\\<pp>' : '\U0001d52d',
|
412 |
+
'\\<qq>' : '\U0001d52e',
|
413 |
+
'\\<rr>' : '\U0001d52f',
|
414 |
+
'\\<ss>' : '\U0001d530',
|
415 |
+
'\\<tt>' : '\U0001d531',
|
416 |
+
'\\<uu>' : '\U0001d532',
|
417 |
+
'\\<vv>' : '\U0001d533',
|
418 |
+
'\\<ww>' : '\U0001d534',
|
419 |
+
'\\<xx>' : '\U0001d535',
|
420 |
+
'\\<yy>' : '\U0001d536',
|
421 |
+
'\\<zz>' : '\U0001d537',
|
422 |
+
'\\<alpha>' : '\U000003b1',
|
423 |
+
'\\<beta>' : '\U000003b2',
|
424 |
+
'\\<gamma>' : '\U000003b3',
|
425 |
+
'\\<delta>' : '\U000003b4',
|
426 |
+
'\\<epsilon>' : '\U000003b5',
|
427 |
+
'\\<zeta>' : '\U000003b6',
|
428 |
+
'\\<eta>' : '\U000003b7',
|
429 |
+
'\\<theta>' : '\U000003b8',
|
430 |
+
'\\<iota>' : '\U000003b9',
|
431 |
+
'\\<kappa>' : '\U000003ba',
|
432 |
+
'\\<lambda>' : '\U000003bb',
|
433 |
+
'\\<mu>' : '\U000003bc',
|
434 |
+
'\\<nu>' : '\U000003bd',
|
435 |
+
'\\<xi>' : '\U000003be',
|
436 |
+
'\\<pi>' : '\U000003c0',
|
437 |
+
'\\<rho>' : '\U000003c1',
|
438 |
+
'\\<sigma>' : '\U000003c3',
|
439 |
+
'\\<tau>' : '\U000003c4',
|
440 |
+
'\\<upsilon>' : '\U000003c5',
|
441 |
+
'\\<phi>' : '\U000003c6',
|
442 |
+
'\\<chi>' : '\U000003c7',
|
443 |
+
'\\<psi>' : '\U000003c8',
|
444 |
+
'\\<omega>' : '\U000003c9',
|
445 |
+
'\\<Gamma>' : '\U00000393',
|
446 |
+
'\\<Delta>' : '\U00000394',
|
447 |
+
'\\<Theta>' : '\U00000398',
|
448 |
+
'\\<Lambda>' : '\U0000039b',
|
449 |
+
'\\<Xi>' : '\U0000039e',
|
450 |
+
'\\<Pi>' : '\U000003a0',
|
451 |
+
'\\<Sigma>' : '\U000003a3',
|
452 |
+
'\\<Upsilon>' : '\U000003a5',
|
453 |
+
'\\<Phi>' : '\U000003a6',
|
454 |
+
'\\<Psi>' : '\U000003a8',
|
455 |
+
'\\<Omega>' : '\U000003a9',
|
456 |
+
'\\<bool>' : '\U0001d539',
|
457 |
+
'\\<complex>' : '\U00002102',
|
458 |
+
'\\<nat>' : '\U00002115',
|
459 |
+
'\\<rat>' : '\U0000211a',
|
460 |
+
'\\<real>' : '\U0000211d',
|
461 |
+
'\\<int>' : '\U00002124',
|
462 |
+
'\\<leftarrow>' : '\U00002190',
|
463 |
+
'\\<longleftarrow>' : '\U000027f5',
|
464 |
+
'\\<rightarrow>' : '\U00002192',
|
465 |
+
'\\<longrightarrow>' : '\U000027f6',
|
466 |
+
'\\<Leftarrow>' : '\U000021d0',
|
467 |
+
'\\<Longleftarrow>' : '\U000027f8',
|
468 |
+
'\\<Rightarrow>' : '\U000021d2',
|
469 |
+
'\\<Longrightarrow>' : '\U000027f9',
|
470 |
+
'\\<leftrightarrow>' : '\U00002194',
|
471 |
+
'\\<longleftrightarrow>' : '\U000027f7',
|
472 |
+
'\\<Leftrightarrow>' : '\U000021d4',
|
473 |
+
'\\<Longleftrightarrow>' : '\U000027fa',
|
474 |
+
'\\<mapsto>' : '\U000021a6',
|
475 |
+
'\\<longmapsto>' : '\U000027fc',
|
476 |
+
'\\<midarrow>' : '\U00002500',
|
477 |
+
'\\<Midarrow>' : '\U00002550',
|
478 |
+
'\\<hookleftarrow>' : '\U000021a9',
|
479 |
+
'\\<hookrightarrow>' : '\U000021aa',
|
480 |
+
'\\<leftharpoondown>' : '\U000021bd',
|
481 |
+
'\\<rightharpoondown>' : '\U000021c1',
|
482 |
+
'\\<leftharpoonup>' : '\U000021bc',
|
483 |
+
'\\<rightharpoonup>' : '\U000021c0',
|
484 |
+
'\\<rightleftharpoons>' : '\U000021cc',
|
485 |
+
'\\<leadsto>' : '\U0000219d',
|
486 |
+
'\\<downharpoonleft>' : '\U000021c3',
|
487 |
+
'\\<downharpoonright>' : '\U000021c2',
|
488 |
+
'\\<upharpoonleft>' : '\U000021bf',
|
489 |
+
'\\<upharpoonright>' : '\U000021be',
|
490 |
+
'\\<restriction>' : '\U000021be',
|
491 |
+
'\\<Colon>' : '\U00002237',
|
492 |
+
'\\<up>' : '\U00002191',
|
493 |
+
'\\<Up>' : '\U000021d1',
|
494 |
+
'\\<down>' : '\U00002193',
|
495 |
+
'\\<Down>' : '\U000021d3',
|
496 |
+
'\\<updown>' : '\U00002195',
|
497 |
+
'\\<Updown>' : '\U000021d5',
|
498 |
+
'\\<langle>' : '\U000027e8',
|
499 |
+
'\\<rangle>' : '\U000027e9',
|
500 |
+
'\\<lceil>' : '\U00002308',
|
501 |
+
'\\<rceil>' : '\U00002309',
|
502 |
+
'\\<lfloor>' : '\U0000230a',
|
503 |
+
'\\<rfloor>' : '\U0000230b',
|
504 |
+
'\\<lparr>' : '\U00002987',
|
505 |
+
'\\<rparr>' : '\U00002988',
|
506 |
+
'\\<lbrakk>' : '\U000027e6',
|
507 |
+
'\\<rbrakk>' : '\U000027e7',
|
508 |
+
'\\<lbrace>' : '\U00002983',
|
509 |
+
'\\<rbrace>' : '\U00002984',
|
510 |
+
'\\<guillemotleft>' : '\U000000ab',
|
511 |
+
'\\<guillemotright>' : '\U000000bb',
|
512 |
+
'\\<bottom>' : '\U000022a5',
|
513 |
+
'\\<top>' : '\U000022a4',
|
514 |
+
'\\<and>' : '\U00002227',
|
515 |
+
'\\<And>' : '\U000022c0',
|
516 |
+
'\\<or>' : '\U00002228',
|
517 |
+
'\\<Or>' : '\U000022c1',
|
518 |
+
'\\<forall>' : '\U00002200',
|
519 |
+
'\\<exists>' : '\U00002203',
|
520 |
+
'\\<nexists>' : '\U00002204',
|
521 |
+
'\\<not>' : '\U000000ac',
|
522 |
+
'\\<box>' : '\U000025a1',
|
523 |
+
'\\<diamond>' : '\U000025c7',
|
524 |
+
'\\<turnstile>' : '\U000022a2',
|
525 |
+
'\\<Turnstile>' : '\U000022a8',
|
526 |
+
'\\<tturnstile>' : '\U000022a9',
|
527 |
+
'\\<TTurnstile>' : '\U000022ab',
|
528 |
+
'\\<stileturn>' : '\U000022a3',
|
529 |
+
'\\<surd>' : '\U0000221a',
|
530 |
+
'\\<le>' : '\U00002264',
|
531 |
+
'\\<ge>' : '\U00002265',
|
532 |
+
'\\<lless>' : '\U0000226a',
|
533 |
+
'\\<ggreater>' : '\U0000226b',
|
534 |
+
'\\<lesssim>' : '\U00002272',
|
535 |
+
'\\<greatersim>' : '\U00002273',
|
536 |
+
'\\<lessapprox>' : '\U00002a85',
|
537 |
+
'\\<greaterapprox>' : '\U00002a86',
|
538 |
+
'\\<in>' : '\U00002208',
|
539 |
+
'\\<notin>' : '\U00002209',
|
540 |
+
'\\<subset>' : '\U00002282',
|
541 |
+
'\\<supset>' : '\U00002283',
|
542 |
+
'\\<subseteq>' : '\U00002286',
|
543 |
+
'\\<supseteq>' : '\U00002287',
|
544 |
+
'\\<sqsubset>' : '\U0000228f',
|
545 |
+
'\\<sqsupset>' : '\U00002290',
|
546 |
+
'\\<sqsubseteq>' : '\U00002291',
|
547 |
+
'\\<sqsupseteq>' : '\U00002292',
|
548 |
+
'\\<inter>' : '\U00002229',
|
549 |
+
'\\<Inter>' : '\U000022c2',
|
550 |
+
'\\<union>' : '\U0000222a',
|
551 |
+
'\\<Union>' : '\U000022c3',
|
552 |
+
'\\<squnion>' : '\U00002294',
|
553 |
+
'\\<Squnion>' : '\U00002a06',
|
554 |
+
'\\<sqinter>' : '\U00002293',
|
555 |
+
'\\<Sqinter>' : '\U00002a05',
|
556 |
+
'\\<setminus>' : '\U00002216',
|
557 |
+
'\\<propto>' : '\U0000221d',
|
558 |
+
'\\<uplus>' : '\U0000228e',
|
559 |
+
'\\<Uplus>' : '\U00002a04',
|
560 |
+
'\\<noteq>' : '\U00002260',
|
561 |
+
'\\<sim>' : '\U0000223c',
|
562 |
+
'\\<doteq>' : '\U00002250',
|
563 |
+
'\\<simeq>' : '\U00002243',
|
564 |
+
'\\<approx>' : '\U00002248',
|
565 |
+
'\\<asymp>' : '\U0000224d',
|
566 |
+
'\\<cong>' : '\U00002245',
|
567 |
+
'\\<smile>' : '\U00002323',
|
568 |
+
'\\<equiv>' : '\U00002261',
|
569 |
+
'\\<frown>' : '\U00002322',
|
570 |
+
'\\<Join>' : '\U000022c8',
|
571 |
+
'\\<bowtie>' : '\U00002a1d',
|
572 |
+
'\\<prec>' : '\U0000227a',
|
573 |
+
'\\<succ>' : '\U0000227b',
|
574 |
+
'\\<preceq>' : '\U0000227c',
|
575 |
+
'\\<succeq>' : '\U0000227d',
|
576 |
+
'\\<parallel>' : '\U00002225',
|
577 |
+
'\\<bar>' : '\U000000a6',
|
578 |
+
'\\<plusminus>' : '\U000000b1',
|
579 |
+
'\\<minusplus>' : '\U00002213',
|
580 |
+
'\\<times>' : '\U000000d7',
|
581 |
+
'\\<div>' : '\U000000f7',
|
582 |
+
'\\<cdot>' : '\U000022c5',
|
583 |
+
'\\<star>' : '\U000022c6',
|
584 |
+
'\\<bullet>' : '\U00002219',
|
585 |
+
'\\<circ>' : '\U00002218',
|
586 |
+
'\\<dagger>' : '\U00002020',
|
587 |
+
'\\<ddagger>' : '\U00002021',
|
588 |
+
'\\<lhd>' : '\U000022b2',
|
589 |
+
'\\<rhd>' : '\U000022b3',
|
590 |
+
'\\<unlhd>' : '\U000022b4',
|
591 |
+
'\\<unrhd>' : '\U000022b5',
|
592 |
+
'\\<triangleleft>' : '\U000025c3',
|
593 |
+
'\\<triangleright>' : '\U000025b9',
|
594 |
+
'\\<triangle>' : '\U000025b3',
|
595 |
+
'\\<triangleq>' : '\U0000225c',
|
596 |
+
'\\<oplus>' : '\U00002295',
|
597 |
+
'\\<Oplus>' : '\U00002a01',
|
598 |
+
'\\<otimes>' : '\U00002297',
|
599 |
+
'\\<Otimes>' : '\U00002a02',
|
600 |
+
'\\<odot>' : '\U00002299',
|
601 |
+
'\\<Odot>' : '\U00002a00',
|
602 |
+
'\\<ominus>' : '\U00002296',
|
603 |
+
'\\<oslash>' : '\U00002298',
|
604 |
+
'\\<dots>' : '\U00002026',
|
605 |
+
'\\<cdots>' : '\U000022ef',
|
606 |
+
'\\<Sum>' : '\U00002211',
|
607 |
+
'\\<Prod>' : '\U0000220f',
|
608 |
+
'\\<Coprod>' : '\U00002210',
|
609 |
+
'\\<infinity>' : '\U0000221e',
|
610 |
+
'\\<integral>' : '\U0000222b',
|
611 |
+
'\\<ointegral>' : '\U0000222e',
|
612 |
+
'\\<clubsuit>' : '\U00002663',
|
613 |
+
'\\<diamondsuit>' : '\U00002662',
|
614 |
+
'\\<heartsuit>' : '\U00002661',
|
615 |
+
'\\<spadesuit>' : '\U00002660',
|
616 |
+
'\\<aleph>' : '\U00002135',
|
617 |
+
'\\<emptyset>' : '\U00002205',
|
618 |
+
'\\<nabla>' : '\U00002207',
|
619 |
+
'\\<partial>' : '\U00002202',
|
620 |
+
'\\<flat>' : '\U0000266d',
|
621 |
+
'\\<natural>' : '\U0000266e',
|
622 |
+
'\\<sharp>' : '\U0000266f',
|
623 |
+
'\\<angle>' : '\U00002220',
|
624 |
+
'\\<copyright>' : '\U000000a9',
|
625 |
+
'\\<registered>' : '\U000000ae',
|
626 |
+
'\\<hyphen>' : '\U000000ad',
|
627 |
+
'\\<inverse>' : '\U000000af',
|
628 |
+
'\\<onequarter>' : '\U000000bc',
|
629 |
+
'\\<onehalf>' : '\U000000bd',
|
630 |
+
'\\<threequarters>' : '\U000000be',
|
631 |
+
'\\<ordfeminine>' : '\U000000aa',
|
632 |
+
'\\<ordmasculine>' : '\U000000ba',
|
633 |
+
'\\<section>' : '\U000000a7',
|
634 |
+
'\\<paragraph>' : '\U000000b6',
|
635 |
+
'\\<exclamdown>' : '\U000000a1',
|
636 |
+
'\\<questiondown>' : '\U000000bf',
|
637 |
+
'\\<euro>' : '\U000020ac',
|
638 |
+
'\\<pounds>' : '\U000000a3',
|
639 |
+
'\\<yen>' : '\U000000a5',
|
640 |
+
'\\<cent>' : '\U000000a2',
|
641 |
+
'\\<currency>' : '\U000000a4',
|
642 |
+
'\\<degree>' : '\U000000b0',
|
643 |
+
'\\<amalg>' : '\U00002a3f',
|
644 |
+
'\\<mho>' : '\U00002127',
|
645 |
+
'\\<lozenge>' : '\U000025ca',
|
646 |
+
'\\<wp>' : '\U00002118',
|
647 |
+
'\\<wrong>' : '\U00002240',
|
648 |
+
'\\<struct>' : '\U000022c4',
|
649 |
+
'\\<acute>' : '\U000000b4',
|
650 |
+
'\\<index>' : '\U00000131',
|
651 |
+
'\\<dieresis>' : '\U000000a8',
|
652 |
+
'\\<cedilla>' : '\U000000b8',
|
653 |
+
'\\<hungarumlaut>' : '\U000002dd',
|
654 |
+
'\\<some>' : '\U000003f5',
|
655 |
+
'\\<newline>' : '\U000023ce',
|
656 |
+
'\\<open>' : '\U00002039',
|
657 |
+
'\\<close>' : '\U0000203a',
|
658 |
+
'\\<here>' : '\U00002302',
|
659 |
+
'\\<^sub>' : '\U000021e9',
|
660 |
+
'\\<^sup>' : '\U000021e7',
|
661 |
+
'\\<^bold>' : '\U00002759',
|
662 |
+
'\\<^bsub>' : '\U000021d8',
|
663 |
+
'\\<^esub>' : '\U000021d9',
|
664 |
+
'\\<^bsup>' : '\U000021d7',
|
665 |
+
'\\<^esup>' : '\U000021d6',
|
666 |
+
}
|
667 |
+
|
668 |
+
lang_map = {'isabelle' : isabelle_symbols, 'latex' : latex_symbols}
|
669 |
+
|
670 |
+
def __init__(self, **options):
|
671 |
+
Filter.__init__(self, **options)
|
672 |
+
lang = get_choice_opt(options, 'lang',
|
673 |
+
['isabelle', 'latex'], 'isabelle')
|
674 |
+
self.symbols = self.lang_map[lang]
|
675 |
+
|
676 |
+
def filter(self, lexer, stream):
|
677 |
+
for ttype, value in stream:
|
678 |
+
if value in self.symbols:
|
679 |
+
yield ttype, self.symbols[value]
|
680 |
+
else:
|
681 |
+
yield ttype, value
|
682 |
+
|
683 |
+
|
684 |
+
class KeywordCaseFilter(Filter):
|
685 |
+
"""Convert keywords to lowercase or uppercase or capitalize them, which
|
686 |
+
means first letter uppercase, rest lowercase.
|
687 |
+
|
688 |
+
This can be useful e.g. if you highlight Pascal code and want to adapt the
|
689 |
+
code to your styleguide.
|
690 |
+
|
691 |
+
Options accepted:
|
692 |
+
|
693 |
+
`case` : string
|
694 |
+
The casing to convert keywords to. Must be one of ``'lower'``,
|
695 |
+
``'upper'`` or ``'capitalize'``. The default is ``'lower'``.
|
696 |
+
"""
|
697 |
+
|
698 |
+
def __init__(self, **options):
|
699 |
+
Filter.__init__(self, **options)
|
700 |
+
case = get_choice_opt(options, 'case',
|
701 |
+
['lower', 'upper', 'capitalize'], 'lower')
|
702 |
+
self.convert = getattr(str, case)
|
703 |
+
|
704 |
+
def filter(self, lexer, stream):
|
705 |
+
for ttype, value in stream:
|
706 |
+
if ttype in Keyword:
|
707 |
+
yield ttype, self.convert(value)
|
708 |
+
else:
|
709 |
+
yield ttype, value
|
710 |
+
|
711 |
+
|
712 |
+
class NameHighlightFilter(Filter):
|
713 |
+
"""Highlight a normal Name (and Name.*) token with a different token type.
|
714 |
+
|
715 |
+
Example::
|
716 |
+
|
717 |
+
filter = NameHighlightFilter(
|
718 |
+
names=['foo', 'bar', 'baz'],
|
719 |
+
tokentype=Name.Function,
|
720 |
+
)
|
721 |
+
|
722 |
+
This would highlight the names "foo", "bar" and "baz"
|
723 |
+
as functions. `Name.Function` is the default token type.
|
724 |
+
|
725 |
+
Options accepted:
|
726 |
+
|
727 |
+
`names` : list of strings
|
728 |
+
A list of names that should be given the different token type.
|
729 |
+
There is no default.
|
730 |
+
`tokentype` : TokenType or string
|
731 |
+
A token type or a string containing a token type name that is
|
732 |
+
used for highlighting the strings in `names`. The default is
|
733 |
+
`Name.Function`.
|
734 |
+
"""
|
735 |
+
|
736 |
+
def __init__(self, **options):
|
737 |
+
Filter.__init__(self, **options)
|
738 |
+
self.names = set(get_list_opt(options, 'names', []))
|
739 |
+
tokentype = options.get('tokentype')
|
740 |
+
if tokentype:
|
741 |
+
self.tokentype = string_to_tokentype(tokentype)
|
742 |
+
else:
|
743 |
+
self.tokentype = Name.Function
|
744 |
+
|
745 |
+
def filter(self, lexer, stream):
|
746 |
+
for ttype, value in stream:
|
747 |
+
if ttype in Name and value in self.names:
|
748 |
+
yield self.tokentype, value
|
749 |
+
else:
|
750 |
+
yield ttype, value
|
751 |
+
|
752 |
+
|
753 |
+
class ErrorToken(Exception):
|
754 |
+
pass
|
755 |
+
|
756 |
+
|
757 |
+
class RaiseOnErrorTokenFilter(Filter):
|
758 |
+
"""Raise an exception when the lexer generates an error token.
|
759 |
+
|
760 |
+
Options accepted:
|
761 |
+
|
762 |
+
`excclass` : Exception class
|
763 |
+
The exception class to raise.
|
764 |
+
The default is `pygments.filters.ErrorToken`.
|
765 |
+
|
766 |
+
.. versionadded:: 0.8
|
767 |
+
"""
|
768 |
+
|
769 |
+
def __init__(self, **options):
|
770 |
+
Filter.__init__(self, **options)
|
771 |
+
self.exception = options.get('excclass', ErrorToken)
|
772 |
+
try:
|
773 |
+
# issubclass() will raise TypeError if first argument is not a class
|
774 |
+
if not issubclass(self.exception, Exception):
|
775 |
+
raise TypeError
|
776 |
+
except TypeError:
|
777 |
+
raise OptionError('excclass option is not an exception class')
|
778 |
+
|
779 |
+
def filter(self, lexer, stream):
|
780 |
+
for ttype, value in stream:
|
781 |
+
if ttype is Error:
|
782 |
+
raise self.exception(value)
|
783 |
+
yield ttype, value
|
784 |
+
|
785 |
+
|
786 |
+
class VisibleWhitespaceFilter(Filter):
|
787 |
+
"""Convert tabs, newlines and/or spaces to visible characters.
|
788 |
+
|
789 |
+
Options accepted:
|
790 |
+
|
791 |
+
`spaces` : string or bool
|
792 |
+
If this is a one-character string, spaces will be replaces by this string.
|
793 |
+
If it is another true value, spaces will be replaced by ``·`` (unicode
|
794 |
+
MIDDLE DOT). If it is a false value, spaces will not be replaced. The
|
795 |
+
default is ``False``.
|
796 |
+
`tabs` : string or bool
|
797 |
+
The same as for `spaces`, but the default replacement character is ``»``
|
798 |
+
(unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK). The default value
|
799 |
+
is ``False``. Note: this will not work if the `tabsize` option for the
|
800 |
+
lexer is nonzero, as tabs will already have been expanded then.
|
801 |
+
`tabsize` : int
|
802 |
+
If tabs are to be replaced by this filter (see the `tabs` option), this
|
803 |
+
is the total number of characters that a tab should be expanded to.
|
804 |
+
The default is ``8``.
|
805 |
+
`newlines` : string or bool
|
806 |
+
The same as for `spaces`, but the default replacement character is ``¶``
|
807 |
+
(unicode PILCROW SIGN). The default value is ``False``.
|
808 |
+
`wstokentype` : bool
|
809 |
+
If true, give whitespace the special `Whitespace` token type. This allows
|
810 |
+
styling the visible whitespace differently (e.g. greyed out), but it can
|
811 |
+
disrupt background colors. The default is ``True``.
|
812 |
+
|
813 |
+
.. versionadded:: 0.8
|
814 |
+
"""
|
815 |
+
|
816 |
+
def __init__(self, **options):
|
817 |
+
Filter.__init__(self, **options)
|
818 |
+
for name, default in [('spaces', '·'),
|
819 |
+
('tabs', '»'),
|
820 |
+
('newlines', '¶')]:
|
821 |
+
opt = options.get(name, False)
|
822 |
+
if isinstance(opt, str) and len(opt) == 1:
|
823 |
+
setattr(self, name, opt)
|
824 |
+
else:
|
825 |
+
setattr(self, name, (opt and default or ''))
|
826 |
+
tabsize = get_int_opt(options, 'tabsize', 8)
|
827 |
+
if self.tabs:
|
828 |
+
self.tabs += ' ' * (tabsize - 1)
|
829 |
+
if self.newlines:
|
830 |
+
self.newlines += '\n'
|
831 |
+
self.wstt = get_bool_opt(options, 'wstokentype', True)
|
832 |
+
|
833 |
+
def filter(self, lexer, stream):
|
834 |
+
if self.wstt:
|
835 |
+
spaces = self.spaces or ' '
|
836 |
+
tabs = self.tabs or '\t'
|
837 |
+
newlines = self.newlines or '\n'
|
838 |
+
regex = re.compile(r'\s')
|
839 |
+
|
840 |
+
def replacefunc(wschar):
|
841 |
+
if wschar == ' ':
|
842 |
+
return spaces
|
843 |
+
elif wschar == '\t':
|
844 |
+
return tabs
|
845 |
+
elif wschar == '\n':
|
846 |
+
return newlines
|
847 |
+
return wschar
|
848 |
+
|
849 |
+
for ttype, value in stream:
|
850 |
+
yield from _replace_special(ttype, value, regex, Whitespace,
|
851 |
+
replacefunc)
|
852 |
+
else:
|
853 |
+
spaces, tabs, newlines = self.spaces, self.tabs, self.newlines
|
854 |
+
# simpler processing
|
855 |
+
for ttype, value in stream:
|
856 |
+
if spaces:
|
857 |
+
value = value.replace(' ', spaces)
|
858 |
+
if tabs:
|
859 |
+
value = value.replace('\t', tabs)
|
860 |
+
if newlines:
|
861 |
+
value = value.replace('\n', newlines)
|
862 |
+
yield ttype, value
|
863 |
+
|
864 |
+
|
865 |
+
class GobbleFilter(Filter):
|
866 |
+
"""Gobbles source code lines (eats initial characters).
|
867 |
+
|
868 |
+
This filter drops the first ``n`` characters off every line of code. This
|
869 |
+
may be useful when the source code fed to the lexer is indented by a fixed
|
870 |
+
amount of space that isn't desired in the output.
|
871 |
+
|
872 |
+
Options accepted:
|
873 |
+
|
874 |
+
`n` : int
|
875 |
+
The number of characters to gobble.
|
876 |
+
|
877 |
+
.. versionadded:: 1.2
|
878 |
+
"""
|
879 |
+
def __init__(self, **options):
|
880 |
+
Filter.__init__(self, **options)
|
881 |
+
self.n = get_int_opt(options, 'n', 0)
|
882 |
+
|
883 |
+
def gobble(self, value, left):
|
884 |
+
if left < len(value):
|
885 |
+
return value[left:], 0
|
886 |
+
else:
|
887 |
+
return '', left - len(value)
|
888 |
+
|
889 |
+
def filter(self, lexer, stream):
|
890 |
+
n = self.n
|
891 |
+
left = n # How many characters left to gobble.
|
892 |
+
for ttype, value in stream:
|
893 |
+
# Remove ``left`` tokens from first line, ``n`` from all others.
|
894 |
+
parts = value.split('\n')
|
895 |
+
(parts[0], left) = self.gobble(parts[0], left)
|
896 |
+
for i in range(1, len(parts)):
|
897 |
+
(parts[i], left) = self.gobble(parts[i], n)
|
898 |
+
value = '\n'.join(parts)
|
899 |
+
|
900 |
+
if value != '':
|
901 |
+
yield ttype, value
|
902 |
+
|
903 |
+
|
904 |
+
class TokenMergeFilter(Filter):
|
905 |
+
"""Merges consecutive tokens with the same token type in the output
|
906 |
+
stream of a lexer.
|
907 |
+
|
908 |
+
.. versionadded:: 1.2
|
909 |
+
"""
|
910 |
+
def __init__(self, **options):
|
911 |
+
Filter.__init__(self, **options)
|
912 |
+
|
913 |
+
def filter(self, lexer, stream):
|
914 |
+
current_type = None
|
915 |
+
current_value = None
|
916 |
+
for ttype, value in stream:
|
917 |
+
if ttype is current_type:
|
918 |
+
current_value += value
|
919 |
+
else:
|
920 |
+
if current_type is not None:
|
921 |
+
yield current_type, current_value
|
922 |
+
current_type = ttype
|
923 |
+
current_value = value
|
924 |
+
if current_type is not None:
|
925 |
+
yield current_type, current_value
|
926 |
+
|
927 |
+
|
928 |
+
FILTERS = {
|
929 |
+
'codetagify': CodeTagFilter,
|
930 |
+
'keywordcase': KeywordCaseFilter,
|
931 |
+
'highlight': NameHighlightFilter,
|
932 |
+
'raiseonerror': RaiseOnErrorTokenFilter,
|
933 |
+
'whitespace': VisibleWhitespaceFilter,
|
934 |
+
'gobble': GobbleFilter,
|
935 |
+
'tokenmerge': TokenMergeFilter,
|
936 |
+
'symbols': SymbolFilter,
|
937 |
+
}
|
env-llmeval/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/bbcode.py
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
pygments.formatters.bbcode
|
3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
4 |
+
|
5 |
+
BBcode formatter.
|
6 |
+
|
7 |
+
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
|
8 |
+
:license: BSD, see LICENSE for details.
|
9 |
+
"""
|
10 |
+
|
11 |
+
|
12 |
+
from pip._vendor.pygments.formatter import Formatter
|
13 |
+
from pip._vendor.pygments.util import get_bool_opt
|
14 |
+
|
15 |
+
__all__ = ['BBCodeFormatter']
|
16 |
+
|
17 |
+
|
18 |
+
class BBCodeFormatter(Formatter):
|
19 |
+
"""
|
20 |
+
Format tokens with BBcodes. These formatting codes are used by many
|
21 |
+
bulletin boards, so you can highlight your sourcecode with pygments before
|
22 |
+
posting it there.
|
23 |
+
|
24 |
+
This formatter has no support for background colors and borders, as there
|
25 |
+
are no common BBcode tags for that.
|
26 |
+
|
27 |
+
Some board systems (e.g. phpBB) don't support colors in their [code] tag,
|
28 |
+
so you can't use the highlighting together with that tag.
|
29 |
+
Text in a [code] tag usually is shown with a monospace font (which this
|
30 |
+
formatter can do with the ``monofont`` option) and no spaces (which you
|
31 |
+
need for indentation) are removed.
|
32 |
+
|
33 |
+
Additional options accepted:
|
34 |
+
|
35 |
+
`style`
|
36 |
+
The style to use, can be a string or a Style subclass (default:
|
37 |
+
``'default'``).
|
38 |
+
|
39 |
+
`codetag`
|
40 |
+
If set to true, put the output into ``[code]`` tags (default:
|
41 |
+
``false``)
|
42 |
+
|
43 |
+
`monofont`
|
44 |
+
If set to true, add a tag to show the code with a monospace font
|
45 |
+
(default: ``false``).
|
46 |
+
"""
|
47 |
+
name = 'BBCode'
|
48 |
+
aliases = ['bbcode', 'bb']
|
49 |
+
filenames = []
|
50 |
+
|
51 |
+
def __init__(self, **options):
|
52 |
+
Formatter.__init__(self, **options)
|
53 |
+
self._code = get_bool_opt(options, 'codetag', False)
|
54 |
+
self._mono = get_bool_opt(options, 'monofont', False)
|
55 |
+
|
56 |
+
self.styles = {}
|
57 |
+
self._make_styles()
|
58 |
+
|
59 |
+
def _make_styles(self):
|
60 |
+
for ttype, ndef in self.style:
|
61 |
+
start = end = ''
|
62 |
+
if ndef['color']:
|
63 |
+
start += '[color=#%s]' % ndef['color']
|
64 |
+
end = '[/color]' + end
|
65 |
+
if ndef['bold']:
|
66 |
+
start += '[b]'
|
67 |
+
end = '[/b]' + end
|
68 |
+
if ndef['italic']:
|
69 |
+
start += '[i]'
|
70 |
+
end = '[/i]' + end
|
71 |
+
if ndef['underline']:
|
72 |
+
start += '[u]'
|
73 |
+
end = '[/u]' + end
|
74 |
+
# there are no common BBcodes for background-color and border
|
75 |
+
|
76 |
+
self.styles[ttype] = start, end
|
77 |
+
|
78 |
+
def format_unencoded(self, tokensource, outfile):
|
79 |
+
if self._code:
|
80 |
+
outfile.write('[code]')
|
81 |
+
if self._mono:
|
82 |
+
outfile.write('[font=monospace]')
|
83 |
+
|
84 |
+
lastval = ''
|
85 |
+
lasttype = None
|
86 |
+
|
87 |
+
for ttype, value in tokensource:
|
88 |
+
while ttype not in self.styles:
|
89 |
+
ttype = ttype.parent
|
90 |
+
if ttype == lasttype:
|
91 |
+
lastval += value
|
92 |
+
else:
|
93 |
+
if lastval:
|
94 |
+
start, end = self.styles[lasttype]
|
95 |
+
outfile.write(''.join((start, lastval, end)))
|
96 |
+
lastval = value
|
97 |
+
lasttype = ttype
|
98 |
+
|
99 |
+
if lastval:
|
100 |
+
start, end = self.styles[lasttype]
|
101 |
+
outfile.write(''.join((start, lastval, end)))
|
102 |
+
|
103 |
+
if self._mono:
|
104 |
+
outfile.write('[/font]')
|
105 |
+
if self._code:
|
106 |
+
outfile.write('[/code]')
|
107 |
+
if self._code or self._mono:
|
108 |
+
outfile.write('\n')
|