Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +3 -0
- llmeval-env/bin/python +3 -0
- llmeval-env/bin/python3 +3 -0
- llmeval-env/bin/python3.10 +3 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__init__.py +18 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/_cmd.py +61 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/adapter.py +137 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/cache.py +43 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +6 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-310.pyc +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +150 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +37 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/compat.py +32 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.py +415 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.py +111 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py +139 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/serialize.py +186 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/wrapper.py +33 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/big5prober.py +47 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/chardistribution.py +233 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py +36 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/escsm.py +246 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312freq.py +283 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/jisfreq.py +325 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/jpcntx.py +233 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langhungarianmodel.py +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langthaimodel.py +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langturkishmodel.py +0 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +54 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +83 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/distlib/__init__.py +23 -0
- llmeval-env/lib/python3.10/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-310.pyc +0 -0
.gitattributes
CHANGED
@@ -57,3 +57,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
60 |
+
llmeval-env/bin/python3.10 filter=lfs diff=lfs merge=lfs -text
|
61 |
+
llmeval-env/bin/python3 filter=lfs diff=lfs merge=lfs -text
|
62 |
+
llmeval-env/bin/python filter=lfs diff=lfs merge=lfs -text
|
llmeval-env/bin/python
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
|
3 |
+
size 5904904
|
llmeval-env/bin/python3
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
|
3 |
+
size 5904904
|
llmeval-env/bin/python3.10
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
|
3 |
+
size 5904904
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__init__.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
"""CacheControl import Interface.
|
6 |
+
|
7 |
+
Make it easy to import from cachecontrol without long namespaces.
|
8 |
+
"""
|
9 |
+
__author__ = "Eric Larson"
|
10 |
+
__email__ = "[email protected]"
|
11 |
+
__version__ = "0.12.10"
|
12 |
+
|
13 |
+
from .wrapper import CacheControl
|
14 |
+
from .adapter import CacheControlAdapter
|
15 |
+
from .controller import CacheController
|
16 |
+
|
17 |
+
import logging
|
18 |
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (643 Bytes). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-310.pyc
ADDED
Binary file (1.58 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-310.pyc
ADDED
Binary file (3.16 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-310.pyc
ADDED
Binary file (1.85 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-310.pyc
ADDED
Binary file (757 Bytes). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-310.pyc
ADDED
Binary file (8.21 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-310.pyc
ADDED
Binary file (2.79 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-310.pyc
ADDED
Binary file (4.72 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-310.pyc
ADDED
Binary file (4.25 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-310.pyc
ADDED
Binary file (688 Bytes). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/_cmd.py
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
import logging
|
6 |
+
|
7 |
+
from pip._vendor import requests
|
8 |
+
|
9 |
+
from pip._vendor.cachecontrol.adapter import CacheControlAdapter
|
10 |
+
from pip._vendor.cachecontrol.cache import DictCache
|
11 |
+
from pip._vendor.cachecontrol.controller import logger
|
12 |
+
|
13 |
+
from argparse import ArgumentParser
|
14 |
+
|
15 |
+
|
16 |
+
def setup_logging():
|
17 |
+
logger.setLevel(logging.DEBUG)
|
18 |
+
handler = logging.StreamHandler()
|
19 |
+
logger.addHandler(handler)
|
20 |
+
|
21 |
+
|
22 |
+
def get_session():
|
23 |
+
adapter = CacheControlAdapter(
|
24 |
+
DictCache(), cache_etags=True, serializer=None, heuristic=None
|
25 |
+
)
|
26 |
+
sess = requests.Session()
|
27 |
+
sess.mount("http://", adapter)
|
28 |
+
sess.mount("https://", adapter)
|
29 |
+
|
30 |
+
sess.cache_controller = adapter.controller
|
31 |
+
return sess
|
32 |
+
|
33 |
+
|
34 |
+
def get_args():
|
35 |
+
parser = ArgumentParser()
|
36 |
+
parser.add_argument("url", help="The URL to try and cache")
|
37 |
+
return parser.parse_args()
|
38 |
+
|
39 |
+
|
40 |
+
def main(args=None):
|
41 |
+
args = get_args()
|
42 |
+
sess = get_session()
|
43 |
+
|
44 |
+
# Make a request to get a response
|
45 |
+
resp = sess.get(args.url)
|
46 |
+
|
47 |
+
# Turn on logging
|
48 |
+
setup_logging()
|
49 |
+
|
50 |
+
# try setting the cache
|
51 |
+
sess.cache_controller.cache_response(resp.request, resp.raw)
|
52 |
+
|
53 |
+
# Now try to get it
|
54 |
+
if sess.cache_controller.cached_request(resp.request):
|
55 |
+
print("Cached!")
|
56 |
+
else:
|
57 |
+
print("Not cached :(")
|
58 |
+
|
59 |
+
|
60 |
+
if __name__ == "__main__":
|
61 |
+
main()
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/adapter.py
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
import types
|
6 |
+
import functools
|
7 |
+
import zlib
|
8 |
+
|
9 |
+
from pip._vendor.requests.adapters import HTTPAdapter
|
10 |
+
|
11 |
+
from .controller import CacheController, PERMANENT_REDIRECT_STATUSES
|
12 |
+
from .cache import DictCache
|
13 |
+
from .filewrapper import CallbackFileWrapper
|
14 |
+
|
15 |
+
|
16 |
+
class CacheControlAdapter(HTTPAdapter):
|
17 |
+
invalidating_methods = {"PUT", "PATCH", "DELETE"}
|
18 |
+
|
19 |
+
def __init__(
|
20 |
+
self,
|
21 |
+
cache=None,
|
22 |
+
cache_etags=True,
|
23 |
+
controller_class=None,
|
24 |
+
serializer=None,
|
25 |
+
heuristic=None,
|
26 |
+
cacheable_methods=None,
|
27 |
+
*args,
|
28 |
+
**kw
|
29 |
+
):
|
30 |
+
super(CacheControlAdapter, self).__init__(*args, **kw)
|
31 |
+
self.cache = DictCache() if cache is None else cache
|
32 |
+
self.heuristic = heuristic
|
33 |
+
self.cacheable_methods = cacheable_methods or ("GET",)
|
34 |
+
|
35 |
+
controller_factory = controller_class or CacheController
|
36 |
+
self.controller = controller_factory(
|
37 |
+
self.cache, cache_etags=cache_etags, serializer=serializer
|
38 |
+
)
|
39 |
+
|
40 |
+
def send(self, request, cacheable_methods=None, **kw):
|
41 |
+
"""
|
42 |
+
Send a request. Use the request information to see if it
|
43 |
+
exists in the cache and cache the response if we need to and can.
|
44 |
+
"""
|
45 |
+
cacheable = cacheable_methods or self.cacheable_methods
|
46 |
+
if request.method in cacheable:
|
47 |
+
try:
|
48 |
+
cached_response = self.controller.cached_request(request)
|
49 |
+
except zlib.error:
|
50 |
+
cached_response = None
|
51 |
+
if cached_response:
|
52 |
+
return self.build_response(request, cached_response, from_cache=True)
|
53 |
+
|
54 |
+
# check for etags and add headers if appropriate
|
55 |
+
request.headers.update(self.controller.conditional_headers(request))
|
56 |
+
|
57 |
+
resp = super(CacheControlAdapter, self).send(request, **kw)
|
58 |
+
|
59 |
+
return resp
|
60 |
+
|
61 |
+
def build_response(
|
62 |
+
self, request, response, from_cache=False, cacheable_methods=None
|
63 |
+
):
|
64 |
+
"""
|
65 |
+
Build a response by making a request or using the cache.
|
66 |
+
|
67 |
+
This will end up calling send and returning a potentially
|
68 |
+
cached response
|
69 |
+
"""
|
70 |
+
cacheable = cacheable_methods or self.cacheable_methods
|
71 |
+
if not from_cache and request.method in cacheable:
|
72 |
+
# Check for any heuristics that might update headers
|
73 |
+
# before trying to cache.
|
74 |
+
if self.heuristic:
|
75 |
+
response = self.heuristic.apply(response)
|
76 |
+
|
77 |
+
# apply any expiration heuristics
|
78 |
+
if response.status == 304:
|
79 |
+
# We must have sent an ETag request. This could mean
|
80 |
+
# that we've been expired already or that we simply
|
81 |
+
# have an etag. In either case, we want to try and
|
82 |
+
# update the cache if that is the case.
|
83 |
+
cached_response = self.controller.update_cached_response(
|
84 |
+
request, response
|
85 |
+
)
|
86 |
+
|
87 |
+
if cached_response is not response:
|
88 |
+
from_cache = True
|
89 |
+
|
90 |
+
# We are done with the server response, read a
|
91 |
+
# possible response body (compliant servers will
|
92 |
+
# not return one, but we cannot be 100% sure) and
|
93 |
+
# release the connection back to the pool.
|
94 |
+
response.read(decode_content=False)
|
95 |
+
response.release_conn()
|
96 |
+
|
97 |
+
response = cached_response
|
98 |
+
|
99 |
+
# We always cache the 301 responses
|
100 |
+
elif int(response.status) in PERMANENT_REDIRECT_STATUSES:
|
101 |
+
self.controller.cache_response(request, response)
|
102 |
+
else:
|
103 |
+
# Wrap the response file with a wrapper that will cache the
|
104 |
+
# response when the stream has been consumed.
|
105 |
+
response._fp = CallbackFileWrapper(
|
106 |
+
response._fp,
|
107 |
+
functools.partial(
|
108 |
+
self.controller.cache_response, request, response
|
109 |
+
),
|
110 |
+
)
|
111 |
+
if response.chunked:
|
112 |
+
super_update_chunk_length = response._update_chunk_length
|
113 |
+
|
114 |
+
def _update_chunk_length(self):
|
115 |
+
super_update_chunk_length()
|
116 |
+
if self.chunk_left == 0:
|
117 |
+
self._fp._close()
|
118 |
+
|
119 |
+
response._update_chunk_length = types.MethodType(
|
120 |
+
_update_chunk_length, response
|
121 |
+
)
|
122 |
+
|
123 |
+
resp = super(CacheControlAdapter, self).build_response(request, response)
|
124 |
+
|
125 |
+
# See if we should invalidate the cache.
|
126 |
+
if request.method in self.invalidating_methods and resp.ok:
|
127 |
+
cache_url = self.controller.cache_url(request.url)
|
128 |
+
self.cache.delete(cache_url)
|
129 |
+
|
130 |
+
# Give the request a from_cache attr to let people use it
|
131 |
+
resp.from_cache = from_cache
|
132 |
+
|
133 |
+
return resp
|
134 |
+
|
135 |
+
def close(self):
|
136 |
+
self.cache.close()
|
137 |
+
super(CacheControlAdapter, self).close()
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/cache.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
"""
|
6 |
+
The cache object API for implementing caches. The default is a thread
|
7 |
+
safe in-memory dictionary.
|
8 |
+
"""
|
9 |
+
from threading import Lock
|
10 |
+
|
11 |
+
|
12 |
+
class BaseCache(object):
|
13 |
+
|
14 |
+
def get(self, key):
|
15 |
+
raise NotImplementedError()
|
16 |
+
|
17 |
+
def set(self, key, value, expires=None):
|
18 |
+
raise NotImplementedError()
|
19 |
+
|
20 |
+
def delete(self, key):
|
21 |
+
raise NotImplementedError()
|
22 |
+
|
23 |
+
def close(self):
|
24 |
+
pass
|
25 |
+
|
26 |
+
|
27 |
+
class DictCache(BaseCache):
|
28 |
+
|
29 |
+
def __init__(self, init_dict=None):
|
30 |
+
self.lock = Lock()
|
31 |
+
self.data = init_dict or {}
|
32 |
+
|
33 |
+
def get(self, key):
|
34 |
+
return self.data.get(key, None)
|
35 |
+
|
36 |
+
def set(self, key, value, expires=None):
|
37 |
+
with self.lock:
|
38 |
+
self.data.update({key: value})
|
39 |
+
|
40 |
+
def delete(self, key):
|
41 |
+
with self.lock:
|
42 |
+
if key in self.data:
|
43 |
+
self.data.pop(key)
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__init__.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
from .file_cache import FileCache # noqa
|
6 |
+
from .redis_cache import RedisCache # noqa
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (294 Bytes). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-310.pyc
ADDED
Binary file (3.37 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-310.pyc
ADDED
Binary file (1.57 kB). View file
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
import hashlib
|
6 |
+
import os
|
7 |
+
from textwrap import dedent
|
8 |
+
|
9 |
+
from ..cache import BaseCache
|
10 |
+
from ..controller import CacheController
|
11 |
+
|
12 |
+
try:
|
13 |
+
FileNotFoundError
|
14 |
+
except NameError:
|
15 |
+
# py2.X
|
16 |
+
FileNotFoundError = (IOError, OSError)
|
17 |
+
|
18 |
+
|
19 |
+
def _secure_open_write(filename, fmode):
|
20 |
+
# We only want to write to this file, so open it in write only mode
|
21 |
+
flags = os.O_WRONLY
|
22 |
+
|
23 |
+
# os.O_CREAT | os.O_EXCL will fail if the file already exists, so we only
|
24 |
+
# will open *new* files.
|
25 |
+
# We specify this because we want to ensure that the mode we pass is the
|
26 |
+
# mode of the file.
|
27 |
+
flags |= os.O_CREAT | os.O_EXCL
|
28 |
+
|
29 |
+
# Do not follow symlinks to prevent someone from making a symlink that
|
30 |
+
# we follow and insecurely open a cache file.
|
31 |
+
if hasattr(os, "O_NOFOLLOW"):
|
32 |
+
flags |= os.O_NOFOLLOW
|
33 |
+
|
34 |
+
# On Windows we'll mark this file as binary
|
35 |
+
if hasattr(os, "O_BINARY"):
|
36 |
+
flags |= os.O_BINARY
|
37 |
+
|
38 |
+
# Before we open our file, we want to delete any existing file that is
|
39 |
+
# there
|
40 |
+
try:
|
41 |
+
os.remove(filename)
|
42 |
+
except (IOError, OSError):
|
43 |
+
# The file must not exist already, so we can just skip ahead to opening
|
44 |
+
pass
|
45 |
+
|
46 |
+
# Open our file, the use of os.O_CREAT | os.O_EXCL will ensure that if a
|
47 |
+
# race condition happens between the os.remove and this line, that an
|
48 |
+
# error will be raised. Because we utilize a lockfile this should only
|
49 |
+
# happen if someone is attempting to attack us.
|
50 |
+
fd = os.open(filename, flags, fmode)
|
51 |
+
try:
|
52 |
+
return os.fdopen(fd, "wb")
|
53 |
+
|
54 |
+
except:
|
55 |
+
# An error occurred wrapping our FD in a file object
|
56 |
+
os.close(fd)
|
57 |
+
raise
|
58 |
+
|
59 |
+
|
60 |
+
class FileCache(BaseCache):
|
61 |
+
|
62 |
+
def __init__(
|
63 |
+
self,
|
64 |
+
directory,
|
65 |
+
forever=False,
|
66 |
+
filemode=0o0600,
|
67 |
+
dirmode=0o0700,
|
68 |
+
use_dir_lock=None,
|
69 |
+
lock_class=None,
|
70 |
+
):
|
71 |
+
|
72 |
+
if use_dir_lock is not None and lock_class is not None:
|
73 |
+
raise ValueError("Cannot use use_dir_lock and lock_class together")
|
74 |
+
|
75 |
+
try:
|
76 |
+
from lockfile import LockFile
|
77 |
+
from lockfile.mkdirlockfile import MkdirLockFile
|
78 |
+
except ImportError:
|
79 |
+
notice = dedent(
|
80 |
+
"""
|
81 |
+
NOTE: In order to use the FileCache you must have
|
82 |
+
lockfile installed. You can install it via pip:
|
83 |
+
pip install lockfile
|
84 |
+
"""
|
85 |
+
)
|
86 |
+
raise ImportError(notice)
|
87 |
+
|
88 |
+
else:
|
89 |
+
if use_dir_lock:
|
90 |
+
lock_class = MkdirLockFile
|
91 |
+
|
92 |
+
elif lock_class is None:
|
93 |
+
lock_class = LockFile
|
94 |
+
|
95 |
+
self.directory = directory
|
96 |
+
self.forever = forever
|
97 |
+
self.filemode = filemode
|
98 |
+
self.dirmode = dirmode
|
99 |
+
self.lock_class = lock_class
|
100 |
+
|
101 |
+
@staticmethod
|
102 |
+
def encode(x):
|
103 |
+
return hashlib.sha224(x.encode()).hexdigest()
|
104 |
+
|
105 |
+
def _fn(self, name):
|
106 |
+
# NOTE: This method should not change as some may depend on it.
|
107 |
+
# See: https://github.com/ionrock/cachecontrol/issues/63
|
108 |
+
hashed = self.encode(name)
|
109 |
+
parts = list(hashed[:5]) + [hashed]
|
110 |
+
return os.path.join(self.directory, *parts)
|
111 |
+
|
112 |
+
def get(self, key):
|
113 |
+
name = self._fn(key)
|
114 |
+
try:
|
115 |
+
with open(name, "rb") as fh:
|
116 |
+
return fh.read()
|
117 |
+
|
118 |
+
except FileNotFoundError:
|
119 |
+
return None
|
120 |
+
|
121 |
+
def set(self, key, value, expires=None):
|
122 |
+
name = self._fn(key)
|
123 |
+
|
124 |
+
# Make sure the directory exists
|
125 |
+
try:
|
126 |
+
os.makedirs(os.path.dirname(name), self.dirmode)
|
127 |
+
except (IOError, OSError):
|
128 |
+
pass
|
129 |
+
|
130 |
+
with self.lock_class(name) as lock:
|
131 |
+
# Write our actual file
|
132 |
+
with _secure_open_write(lock.path, self.filemode) as fh:
|
133 |
+
fh.write(value)
|
134 |
+
|
135 |
+
def delete(self, key):
|
136 |
+
name = self._fn(key)
|
137 |
+
if not self.forever:
|
138 |
+
try:
|
139 |
+
os.remove(name)
|
140 |
+
except FileNotFoundError:
|
141 |
+
pass
|
142 |
+
|
143 |
+
|
144 |
+
def url_to_file_path(url, filecache):
|
145 |
+
"""Return the file cache path based on the URL.
|
146 |
+
|
147 |
+
This does not ensure the file exists!
|
148 |
+
"""
|
149 |
+
key = CacheController.cache_url(url)
|
150 |
+
return filecache._fn(key)
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
from __future__ import division
|
6 |
+
|
7 |
+
from datetime import datetime
|
8 |
+
from pip._vendor.cachecontrol.cache import BaseCache
|
9 |
+
|
10 |
+
|
11 |
+
class RedisCache(BaseCache):
|
12 |
+
|
13 |
+
def __init__(self, conn):
|
14 |
+
self.conn = conn
|
15 |
+
|
16 |
+
def get(self, key):
|
17 |
+
return self.conn.get(key)
|
18 |
+
|
19 |
+
def set(self, key, value, expires=None):
|
20 |
+
if not expires:
|
21 |
+
self.conn.set(key, value)
|
22 |
+
else:
|
23 |
+
expires = expires - datetime.utcnow()
|
24 |
+
self.conn.setex(key, int(expires.total_seconds()), value)
|
25 |
+
|
26 |
+
def delete(self, key):
|
27 |
+
self.conn.delete(key)
|
28 |
+
|
29 |
+
def clear(self):
|
30 |
+
"""Helper for clearing all the keys in a database. Use with
|
31 |
+
caution!"""
|
32 |
+
for key in self.conn.keys():
|
33 |
+
self.conn.delete(key)
|
34 |
+
|
35 |
+
def close(self):
|
36 |
+
"""Redis uses connection pooling, no need to close the connection."""
|
37 |
+
pass
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/compat.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
try:
|
6 |
+
from urllib.parse import urljoin
|
7 |
+
except ImportError:
|
8 |
+
from urlparse import urljoin
|
9 |
+
|
10 |
+
|
11 |
+
try:
|
12 |
+
import cPickle as pickle
|
13 |
+
except ImportError:
|
14 |
+
import pickle
|
15 |
+
|
16 |
+
# Handle the case where the requests module has been patched to not have
|
17 |
+
# urllib3 bundled as part of its source.
|
18 |
+
try:
|
19 |
+
from pip._vendor.requests.packages.urllib3.response import HTTPResponse
|
20 |
+
except ImportError:
|
21 |
+
from pip._vendor.urllib3.response import HTTPResponse
|
22 |
+
|
23 |
+
try:
|
24 |
+
from pip._vendor.requests.packages.urllib3.util import is_fp_closed
|
25 |
+
except ImportError:
|
26 |
+
from pip._vendor.urllib3.util import is_fp_closed
|
27 |
+
|
28 |
+
# Replicate some six behaviour
|
29 |
+
try:
|
30 |
+
text_type = unicode
|
31 |
+
except NameError:
|
32 |
+
text_type = str
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.py
ADDED
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
"""
|
6 |
+
The httplib2 algorithms ported for use with requests.
|
7 |
+
"""
|
8 |
+
import logging
|
9 |
+
import re
|
10 |
+
import calendar
|
11 |
+
import time
|
12 |
+
from email.utils import parsedate_tz
|
13 |
+
|
14 |
+
from pip._vendor.requests.structures import CaseInsensitiveDict
|
15 |
+
|
16 |
+
from .cache import DictCache
|
17 |
+
from .serialize import Serializer
|
18 |
+
|
19 |
+
|
20 |
+
logger = logging.getLogger(__name__)
|
21 |
+
|
22 |
+
URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?")
|
23 |
+
|
24 |
+
PERMANENT_REDIRECT_STATUSES = (301, 308)
|
25 |
+
|
26 |
+
|
27 |
+
def parse_uri(uri):
|
28 |
+
"""Parses a URI using the regex given in Appendix B of RFC 3986.
|
29 |
+
|
30 |
+
(scheme, authority, path, query, fragment) = parse_uri(uri)
|
31 |
+
"""
|
32 |
+
groups = URI.match(uri).groups()
|
33 |
+
return (groups[1], groups[3], groups[4], groups[6], groups[8])
|
34 |
+
|
35 |
+
|
36 |
+
class CacheController(object):
|
37 |
+
"""An interface to see if request should cached or not.
|
38 |
+
"""
|
39 |
+
|
40 |
+
def __init__(
|
41 |
+
self, cache=None, cache_etags=True, serializer=None, status_codes=None
|
42 |
+
):
|
43 |
+
self.cache = DictCache() if cache is None else cache
|
44 |
+
self.cache_etags = cache_etags
|
45 |
+
self.serializer = serializer or Serializer()
|
46 |
+
self.cacheable_status_codes = status_codes or (200, 203, 300, 301, 308)
|
47 |
+
|
48 |
+
@classmethod
|
49 |
+
def _urlnorm(cls, uri):
|
50 |
+
"""Normalize the URL to create a safe key for the cache"""
|
51 |
+
(scheme, authority, path, query, fragment) = parse_uri(uri)
|
52 |
+
if not scheme or not authority:
|
53 |
+
raise Exception("Only absolute URIs are allowed. uri = %s" % uri)
|
54 |
+
|
55 |
+
scheme = scheme.lower()
|
56 |
+
authority = authority.lower()
|
57 |
+
|
58 |
+
if not path:
|
59 |
+
path = "/"
|
60 |
+
|
61 |
+
# Could do syntax based normalization of the URI before
|
62 |
+
# computing the digest. See Section 6.2.2 of Std 66.
|
63 |
+
request_uri = query and "?".join([path, query]) or path
|
64 |
+
defrag_uri = scheme + "://" + authority + request_uri
|
65 |
+
|
66 |
+
return defrag_uri
|
67 |
+
|
68 |
+
@classmethod
|
69 |
+
def cache_url(cls, uri):
|
70 |
+
return cls._urlnorm(uri)
|
71 |
+
|
72 |
+
def parse_cache_control(self, headers):
|
73 |
+
known_directives = {
|
74 |
+
# https://tools.ietf.org/html/rfc7234#section-5.2
|
75 |
+
"max-age": (int, True),
|
76 |
+
"max-stale": (int, False),
|
77 |
+
"min-fresh": (int, True),
|
78 |
+
"no-cache": (None, False),
|
79 |
+
"no-store": (None, False),
|
80 |
+
"no-transform": (None, False),
|
81 |
+
"only-if-cached": (None, False),
|
82 |
+
"must-revalidate": (None, False),
|
83 |
+
"public": (None, False),
|
84 |
+
"private": (None, False),
|
85 |
+
"proxy-revalidate": (None, False),
|
86 |
+
"s-maxage": (int, True),
|
87 |
+
}
|
88 |
+
|
89 |
+
cc_headers = headers.get("cache-control", headers.get("Cache-Control", ""))
|
90 |
+
|
91 |
+
retval = {}
|
92 |
+
|
93 |
+
for cc_directive in cc_headers.split(","):
|
94 |
+
if not cc_directive.strip():
|
95 |
+
continue
|
96 |
+
|
97 |
+
parts = cc_directive.split("=", 1)
|
98 |
+
directive = parts[0].strip()
|
99 |
+
|
100 |
+
try:
|
101 |
+
typ, required = known_directives[directive]
|
102 |
+
except KeyError:
|
103 |
+
logger.debug("Ignoring unknown cache-control directive: %s", directive)
|
104 |
+
continue
|
105 |
+
|
106 |
+
if not typ or not required:
|
107 |
+
retval[directive] = None
|
108 |
+
if typ:
|
109 |
+
try:
|
110 |
+
retval[directive] = typ(parts[1].strip())
|
111 |
+
except IndexError:
|
112 |
+
if required:
|
113 |
+
logger.debug(
|
114 |
+
"Missing value for cache-control " "directive: %s",
|
115 |
+
directive,
|
116 |
+
)
|
117 |
+
except ValueError:
|
118 |
+
logger.debug(
|
119 |
+
"Invalid value for cache-control directive " "%s, must be %s",
|
120 |
+
directive,
|
121 |
+
typ.__name__,
|
122 |
+
)
|
123 |
+
|
124 |
+
return retval
|
125 |
+
|
126 |
+
def cached_request(self, request):
|
127 |
+
"""
|
128 |
+
Return a cached response if it exists in the cache, otherwise
|
129 |
+
return False.
|
130 |
+
"""
|
131 |
+
cache_url = self.cache_url(request.url)
|
132 |
+
logger.debug('Looking up "%s" in the cache', cache_url)
|
133 |
+
cc = self.parse_cache_control(request.headers)
|
134 |
+
|
135 |
+
# Bail out if the request insists on fresh data
|
136 |
+
if "no-cache" in cc:
|
137 |
+
logger.debug('Request header has "no-cache", cache bypassed')
|
138 |
+
return False
|
139 |
+
|
140 |
+
if "max-age" in cc and cc["max-age"] == 0:
|
141 |
+
logger.debug('Request header has "max_age" as 0, cache bypassed')
|
142 |
+
return False
|
143 |
+
|
144 |
+
# Request allows serving from the cache, let's see if we find something
|
145 |
+
cache_data = self.cache.get(cache_url)
|
146 |
+
if cache_data is None:
|
147 |
+
logger.debug("No cache entry available")
|
148 |
+
return False
|
149 |
+
|
150 |
+
# Check whether it can be deserialized
|
151 |
+
resp = self.serializer.loads(request, cache_data)
|
152 |
+
if not resp:
|
153 |
+
logger.warning("Cache entry deserialization failed, entry ignored")
|
154 |
+
return False
|
155 |
+
|
156 |
+
# If we have a cached permanent redirect, return it immediately. We
|
157 |
+
# don't need to test our response for other headers b/c it is
|
158 |
+
# intrinsically "cacheable" as it is Permanent.
|
159 |
+
#
|
160 |
+
# See:
|
161 |
+
# https://tools.ietf.org/html/rfc7231#section-6.4.2
|
162 |
+
#
|
163 |
+
# Client can try to refresh the value by repeating the request
|
164 |
+
# with cache busting headers as usual (ie no-cache).
|
165 |
+
if int(resp.status) in PERMANENT_REDIRECT_STATUSES:
|
166 |
+
msg = (
|
167 |
+
"Returning cached permanent redirect response "
|
168 |
+
"(ignoring date and etag information)"
|
169 |
+
)
|
170 |
+
logger.debug(msg)
|
171 |
+
return resp
|
172 |
+
|
173 |
+
headers = CaseInsensitiveDict(resp.headers)
|
174 |
+
if not headers or "date" not in headers:
|
175 |
+
if "etag" not in headers:
|
176 |
+
# Without date or etag, the cached response can never be used
|
177 |
+
# and should be deleted.
|
178 |
+
logger.debug("Purging cached response: no date or etag")
|
179 |
+
self.cache.delete(cache_url)
|
180 |
+
logger.debug("Ignoring cached response: no date")
|
181 |
+
return False
|
182 |
+
|
183 |
+
now = time.time()
|
184 |
+
date = calendar.timegm(parsedate_tz(headers["date"]))
|
185 |
+
current_age = max(0, now - date)
|
186 |
+
logger.debug("Current age based on date: %i", current_age)
|
187 |
+
|
188 |
+
# TODO: There is an assumption that the result will be a
|
189 |
+
# urllib3 response object. This may not be best since we
|
190 |
+
# could probably avoid instantiating or constructing the
|
191 |
+
# response until we know we need it.
|
192 |
+
resp_cc = self.parse_cache_control(headers)
|
193 |
+
|
194 |
+
# determine freshness
|
195 |
+
freshness_lifetime = 0
|
196 |
+
|
197 |
+
# Check the max-age pragma in the cache control header
|
198 |
+
if "max-age" in resp_cc:
|
199 |
+
freshness_lifetime = resp_cc["max-age"]
|
200 |
+
logger.debug("Freshness lifetime from max-age: %i", freshness_lifetime)
|
201 |
+
|
202 |
+
# If there isn't a max-age, check for an expires header
|
203 |
+
elif "expires" in headers:
|
204 |
+
expires = parsedate_tz(headers["expires"])
|
205 |
+
if expires is not None:
|
206 |
+
expire_time = calendar.timegm(expires) - date
|
207 |
+
freshness_lifetime = max(0, expire_time)
|
208 |
+
logger.debug("Freshness lifetime from expires: %i", freshness_lifetime)
|
209 |
+
|
210 |
+
# Determine if we are setting freshness limit in the
|
211 |
+
# request. Note, this overrides what was in the response.
|
212 |
+
if "max-age" in cc:
|
213 |
+
freshness_lifetime = cc["max-age"]
|
214 |
+
logger.debug(
|
215 |
+
"Freshness lifetime from request max-age: %i", freshness_lifetime
|
216 |
+
)
|
217 |
+
|
218 |
+
if "min-fresh" in cc:
|
219 |
+
min_fresh = cc["min-fresh"]
|
220 |
+
# adjust our current age by our min fresh
|
221 |
+
current_age += min_fresh
|
222 |
+
logger.debug("Adjusted current age from min-fresh: %i", current_age)
|
223 |
+
|
224 |
+
# Return entry if it is fresh enough
|
225 |
+
if freshness_lifetime > current_age:
|
226 |
+
logger.debug('The response is "fresh", returning cached response')
|
227 |
+
logger.debug("%i > %i", freshness_lifetime, current_age)
|
228 |
+
return resp
|
229 |
+
|
230 |
+
# we're not fresh. If we don't have an Etag, clear it out
|
231 |
+
if "etag" not in headers:
|
232 |
+
logger.debug('The cached response is "stale" with no etag, purging')
|
233 |
+
self.cache.delete(cache_url)
|
234 |
+
|
235 |
+
# return the original handler
|
236 |
+
return False
|
237 |
+
|
238 |
+
def conditional_headers(self, request):
|
239 |
+
cache_url = self.cache_url(request.url)
|
240 |
+
resp = self.serializer.loads(request, self.cache.get(cache_url))
|
241 |
+
new_headers = {}
|
242 |
+
|
243 |
+
if resp:
|
244 |
+
headers = CaseInsensitiveDict(resp.headers)
|
245 |
+
|
246 |
+
if "etag" in headers:
|
247 |
+
new_headers["If-None-Match"] = headers["ETag"]
|
248 |
+
|
249 |
+
if "last-modified" in headers:
|
250 |
+
new_headers["If-Modified-Since"] = headers["Last-Modified"]
|
251 |
+
|
252 |
+
return new_headers
|
253 |
+
|
254 |
+
def cache_response(self, request, response, body=None, status_codes=None):
|
255 |
+
"""
|
256 |
+
Algorithm for caching requests.
|
257 |
+
|
258 |
+
This assumes a requests Response object.
|
259 |
+
"""
|
260 |
+
# From httplib2: Don't cache 206's since we aren't going to
|
261 |
+
# handle byte range requests
|
262 |
+
cacheable_status_codes = status_codes or self.cacheable_status_codes
|
263 |
+
if response.status not in cacheable_status_codes:
|
264 |
+
logger.debug(
|
265 |
+
"Status code %s not in %s", response.status, cacheable_status_codes
|
266 |
+
)
|
267 |
+
return
|
268 |
+
|
269 |
+
response_headers = CaseInsensitiveDict(response.headers)
|
270 |
+
|
271 |
+
if "date" in response_headers:
|
272 |
+
date = calendar.timegm(parsedate_tz(response_headers["date"]))
|
273 |
+
else:
|
274 |
+
date = 0
|
275 |
+
|
276 |
+
# If we've been given a body, our response has a Content-Length, that
|
277 |
+
# Content-Length is valid then we can check to see if the body we've
|
278 |
+
# been given matches the expected size, and if it doesn't we'll just
|
279 |
+
# skip trying to cache it.
|
280 |
+
if (
|
281 |
+
body is not None
|
282 |
+
and "content-length" in response_headers
|
283 |
+
and response_headers["content-length"].isdigit()
|
284 |
+
and int(response_headers["content-length"]) != len(body)
|
285 |
+
):
|
286 |
+
return
|
287 |
+
|
288 |
+
cc_req = self.parse_cache_control(request.headers)
|
289 |
+
cc = self.parse_cache_control(response_headers)
|
290 |
+
|
291 |
+
cache_url = self.cache_url(request.url)
|
292 |
+
logger.debug('Updating cache with response from "%s"', cache_url)
|
293 |
+
|
294 |
+
# Delete it from the cache if we happen to have it stored there
|
295 |
+
no_store = False
|
296 |
+
if "no-store" in cc:
|
297 |
+
no_store = True
|
298 |
+
logger.debug('Response header has "no-store"')
|
299 |
+
if "no-store" in cc_req:
|
300 |
+
no_store = True
|
301 |
+
logger.debug('Request header has "no-store"')
|
302 |
+
if no_store and self.cache.get(cache_url):
|
303 |
+
logger.debug('Purging existing cache entry to honor "no-store"')
|
304 |
+
self.cache.delete(cache_url)
|
305 |
+
if no_store:
|
306 |
+
return
|
307 |
+
|
308 |
+
# https://tools.ietf.org/html/rfc7234#section-4.1:
|
309 |
+
# A Vary header field-value of "*" always fails to match.
|
310 |
+
# Storing such a response leads to a deserialization warning
|
311 |
+
# during cache lookup and is not allowed to ever be served,
|
312 |
+
# so storing it can be avoided.
|
313 |
+
if "*" in response_headers.get("vary", ""):
|
314 |
+
logger.debug('Response header has "Vary: *"')
|
315 |
+
return
|
316 |
+
|
317 |
+
# If we've been given an etag, then keep the response
|
318 |
+
if self.cache_etags and "etag" in response_headers:
|
319 |
+
expires_time = 0
|
320 |
+
if response_headers.get("expires"):
|
321 |
+
expires = parsedate_tz(response_headers["expires"])
|
322 |
+
if expires is not None:
|
323 |
+
expires_time = calendar.timegm(expires) - date
|
324 |
+
|
325 |
+
expires_time = max(expires_time, 14 * 86400)
|
326 |
+
|
327 |
+
logger.debug("etag object cached for {0} seconds".format(expires_time))
|
328 |
+
logger.debug("Caching due to etag")
|
329 |
+
self.cache.set(
|
330 |
+
cache_url,
|
331 |
+
self.serializer.dumps(request, response, body),
|
332 |
+
expires=expires_time,
|
333 |
+
)
|
334 |
+
|
335 |
+
# Add to the cache any permanent redirects. We do this before looking
|
336 |
+
# that the Date headers.
|
337 |
+
elif int(response.status) in PERMANENT_REDIRECT_STATUSES:
|
338 |
+
logger.debug("Caching permanent redirect")
|
339 |
+
self.cache.set(cache_url, self.serializer.dumps(request, response, b""))
|
340 |
+
|
341 |
+
# Add to the cache if the response headers demand it. If there
|
342 |
+
# is no date header then we can't do anything about expiring
|
343 |
+
# the cache.
|
344 |
+
elif "date" in response_headers:
|
345 |
+
date = calendar.timegm(parsedate_tz(response_headers["date"]))
|
346 |
+
# cache when there is a max-age > 0
|
347 |
+
if "max-age" in cc and cc["max-age"] > 0:
|
348 |
+
logger.debug("Caching b/c date exists and max-age > 0")
|
349 |
+
expires_time = cc["max-age"]
|
350 |
+
self.cache.set(
|
351 |
+
cache_url,
|
352 |
+
self.serializer.dumps(request, response, body),
|
353 |
+
expires=expires_time,
|
354 |
+
)
|
355 |
+
|
356 |
+
# If the request can expire, it means we should cache it
|
357 |
+
# in the meantime.
|
358 |
+
elif "expires" in response_headers:
|
359 |
+
if response_headers["expires"]:
|
360 |
+
expires = parsedate_tz(response_headers["expires"])
|
361 |
+
if expires is not None:
|
362 |
+
expires_time = calendar.timegm(expires) - date
|
363 |
+
else:
|
364 |
+
expires_time = None
|
365 |
+
|
366 |
+
logger.debug(
|
367 |
+
"Caching b/c of expires header. expires in {0} seconds".format(
|
368 |
+
expires_time
|
369 |
+
)
|
370 |
+
)
|
371 |
+
self.cache.set(
|
372 |
+
cache_url,
|
373 |
+
self.serializer.dumps(request, response, body=body),
|
374 |
+
expires=expires_time,
|
375 |
+
)
|
376 |
+
|
377 |
+
def update_cached_response(self, request, response):
|
378 |
+
"""On a 304 we will get a new set of headers that we want to
|
379 |
+
update our cached value with, assuming we have one.
|
380 |
+
|
381 |
+
This should only ever be called when we've sent an ETag and
|
382 |
+
gotten a 304 as the response.
|
383 |
+
"""
|
384 |
+
cache_url = self.cache_url(request.url)
|
385 |
+
|
386 |
+
cached_response = self.serializer.loads(request, self.cache.get(cache_url))
|
387 |
+
|
388 |
+
if not cached_response:
|
389 |
+
# we didn't have a cached response
|
390 |
+
return response
|
391 |
+
|
392 |
+
# Lets update our headers with the headers from the new request:
|
393 |
+
# http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-4.1
|
394 |
+
#
|
395 |
+
# The server isn't supposed to send headers that would make
|
396 |
+
# the cached body invalid. But... just in case, we'll be sure
|
397 |
+
# to strip out ones we know that might be problmatic due to
|
398 |
+
# typical assumptions.
|
399 |
+
excluded_headers = ["content-length"]
|
400 |
+
|
401 |
+
cached_response.headers.update(
|
402 |
+
dict(
|
403 |
+
(k, v)
|
404 |
+
for k, v in response.headers.items()
|
405 |
+
if k.lower() not in excluded_headers
|
406 |
+
)
|
407 |
+
)
|
408 |
+
|
409 |
+
# we want a 200 b/c we have content via the cache
|
410 |
+
cached_response.status = 200
|
411 |
+
|
412 |
+
# update our cache
|
413 |
+
self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
|
414 |
+
|
415 |
+
return cached_response
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.py
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
from tempfile import NamedTemporaryFile
|
6 |
+
import mmap
|
7 |
+
|
8 |
+
|
9 |
+
class CallbackFileWrapper(object):
|
10 |
+
"""
|
11 |
+
Small wrapper around a fp object which will tee everything read into a
|
12 |
+
buffer, and when that file is closed it will execute a callback with the
|
13 |
+
contents of that buffer.
|
14 |
+
|
15 |
+
All attributes are proxied to the underlying file object.
|
16 |
+
|
17 |
+
This class uses members with a double underscore (__) leading prefix so as
|
18 |
+
not to accidentally shadow an attribute.
|
19 |
+
|
20 |
+
The data is stored in a temporary file until it is all available. As long
|
21 |
+
as the temporary files directory is disk-based (sometimes it's a
|
22 |
+
memory-backed-``tmpfs`` on Linux), data will be unloaded to disk if memory
|
23 |
+
pressure is high. For small files the disk usually won't be used at all,
|
24 |
+
it'll all be in the filesystem memory cache, so there should be no
|
25 |
+
performance impact.
|
26 |
+
"""
|
27 |
+
|
28 |
+
def __init__(self, fp, callback):
|
29 |
+
self.__buf = NamedTemporaryFile("rb+", delete=True)
|
30 |
+
self.__fp = fp
|
31 |
+
self.__callback = callback
|
32 |
+
|
33 |
+
def __getattr__(self, name):
|
34 |
+
# The vaguaries of garbage collection means that self.__fp is
|
35 |
+
# not always set. By using __getattribute__ and the private
|
36 |
+
# name[0] allows looking up the attribute value and raising an
|
37 |
+
# AttributeError when it doesn't exist. This stop thigns from
|
38 |
+
# infinitely recursing calls to getattr in the case where
|
39 |
+
# self.__fp hasn't been set.
|
40 |
+
#
|
41 |
+
# [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers
|
42 |
+
fp = self.__getattribute__("_CallbackFileWrapper__fp")
|
43 |
+
return getattr(fp, name)
|
44 |
+
|
45 |
+
def __is_fp_closed(self):
|
46 |
+
try:
|
47 |
+
return self.__fp.fp is None
|
48 |
+
|
49 |
+
except AttributeError:
|
50 |
+
pass
|
51 |
+
|
52 |
+
try:
|
53 |
+
return self.__fp.closed
|
54 |
+
|
55 |
+
except AttributeError:
|
56 |
+
pass
|
57 |
+
|
58 |
+
# We just don't cache it then.
|
59 |
+
# TODO: Add some logging here...
|
60 |
+
return False
|
61 |
+
|
62 |
+
def _close(self):
|
63 |
+
if self.__callback:
|
64 |
+
if self.__buf.tell() == 0:
|
65 |
+
# Empty file:
|
66 |
+
result = b""
|
67 |
+
else:
|
68 |
+
# Return the data without actually loading it into memory,
|
69 |
+
# relying on Python's buffer API and mmap(). mmap() just gives
|
70 |
+
# a view directly into the filesystem's memory cache, so it
|
71 |
+
# doesn't result in duplicate memory use.
|
72 |
+
self.__buf.seek(0, 0)
|
73 |
+
result = memoryview(
|
74 |
+
mmap.mmap(self.__buf.fileno(), 0, access=mmap.ACCESS_READ)
|
75 |
+
)
|
76 |
+
self.__callback(result)
|
77 |
+
|
78 |
+
# We assign this to None here, because otherwise we can get into
|
79 |
+
# really tricky problems where the CPython interpreter dead locks
|
80 |
+
# because the callback is holding a reference to something which
|
81 |
+
# has a __del__ method. Setting this to None breaks the cycle
|
82 |
+
# and allows the garbage collector to do it's thing normally.
|
83 |
+
self.__callback = None
|
84 |
+
|
85 |
+
# Closing the temporary file releases memory and frees disk space.
|
86 |
+
# Important when caching big files.
|
87 |
+
self.__buf.close()
|
88 |
+
|
89 |
+
def read(self, amt=None):
|
90 |
+
data = self.__fp.read(amt)
|
91 |
+
if data:
|
92 |
+
# We may be dealing with b'', a sign that things are over:
|
93 |
+
# it's passed e.g. after we've already closed self.__buf.
|
94 |
+
self.__buf.write(data)
|
95 |
+
if self.__is_fp_closed():
|
96 |
+
self._close()
|
97 |
+
|
98 |
+
return data
|
99 |
+
|
100 |
+
def _safe_read(self, amt):
|
101 |
+
data = self.__fp._safe_read(amt)
|
102 |
+
if amt == 2 and data == b"\r\n":
|
103 |
+
# urllib executes this read to toss the CRLF at the end
|
104 |
+
# of the chunk.
|
105 |
+
return data
|
106 |
+
|
107 |
+
self.__buf.write(data)
|
108 |
+
if self.__is_fp_closed():
|
109 |
+
self._close()
|
110 |
+
|
111 |
+
return data
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
import calendar
|
6 |
+
import time
|
7 |
+
|
8 |
+
from email.utils import formatdate, parsedate, parsedate_tz
|
9 |
+
|
10 |
+
from datetime import datetime, timedelta
|
11 |
+
|
12 |
+
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
|
13 |
+
|
14 |
+
|
15 |
+
def expire_after(delta, date=None):
|
16 |
+
date = date or datetime.utcnow()
|
17 |
+
return date + delta
|
18 |
+
|
19 |
+
|
20 |
+
def datetime_to_header(dt):
|
21 |
+
return formatdate(calendar.timegm(dt.timetuple()))
|
22 |
+
|
23 |
+
|
24 |
+
class BaseHeuristic(object):
|
25 |
+
|
26 |
+
def warning(self, response):
|
27 |
+
"""
|
28 |
+
Return a valid 1xx warning header value describing the cache
|
29 |
+
adjustments.
|
30 |
+
|
31 |
+
The response is provided too allow warnings like 113
|
32 |
+
http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need
|
33 |
+
to explicitly say response is over 24 hours old.
|
34 |
+
"""
|
35 |
+
return '110 - "Response is Stale"'
|
36 |
+
|
37 |
+
def update_headers(self, response):
|
38 |
+
"""Update the response headers with any new headers.
|
39 |
+
|
40 |
+
NOTE: This SHOULD always include some Warning header to
|
41 |
+
signify that the response was cached by the client, not
|
42 |
+
by way of the provided headers.
|
43 |
+
"""
|
44 |
+
return {}
|
45 |
+
|
46 |
+
def apply(self, response):
|
47 |
+
updated_headers = self.update_headers(response)
|
48 |
+
|
49 |
+
if updated_headers:
|
50 |
+
response.headers.update(updated_headers)
|
51 |
+
warning_header_value = self.warning(response)
|
52 |
+
if warning_header_value is not None:
|
53 |
+
response.headers.update({"Warning": warning_header_value})
|
54 |
+
|
55 |
+
return response
|
56 |
+
|
57 |
+
|
58 |
+
class OneDayCache(BaseHeuristic):
|
59 |
+
"""
|
60 |
+
Cache the response by providing an expires 1 day in the
|
61 |
+
future.
|
62 |
+
"""
|
63 |
+
|
64 |
+
def update_headers(self, response):
|
65 |
+
headers = {}
|
66 |
+
|
67 |
+
if "expires" not in response.headers:
|
68 |
+
date = parsedate(response.headers["date"])
|
69 |
+
expires = expire_after(timedelta(days=1), date=datetime(*date[:6]))
|
70 |
+
headers["expires"] = datetime_to_header(expires)
|
71 |
+
headers["cache-control"] = "public"
|
72 |
+
return headers
|
73 |
+
|
74 |
+
|
75 |
+
class ExpiresAfter(BaseHeuristic):
|
76 |
+
"""
|
77 |
+
Cache **all** requests for a defined time period.
|
78 |
+
"""
|
79 |
+
|
80 |
+
def __init__(self, **kw):
|
81 |
+
self.delta = timedelta(**kw)
|
82 |
+
|
83 |
+
def update_headers(self, response):
|
84 |
+
expires = expire_after(self.delta)
|
85 |
+
return {"expires": datetime_to_header(expires), "cache-control": "public"}
|
86 |
+
|
87 |
+
def warning(self, response):
|
88 |
+
tmpl = "110 - Automatically cached for %s. Response might be stale"
|
89 |
+
return tmpl % self.delta
|
90 |
+
|
91 |
+
|
92 |
+
class LastModified(BaseHeuristic):
|
93 |
+
"""
|
94 |
+
If there is no Expires header already, fall back on Last-Modified
|
95 |
+
using the heuristic from
|
96 |
+
http://tools.ietf.org/html/rfc7234#section-4.2.2
|
97 |
+
to calculate a reasonable value.
|
98 |
+
|
99 |
+
Firefox also does something like this per
|
100 |
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FAQ
|
101 |
+
http://lxr.mozilla.org/mozilla-release/source/netwerk/protocol/http/nsHttpResponseHead.cpp#397
|
102 |
+
Unlike mozilla we limit this to 24-hr.
|
103 |
+
"""
|
104 |
+
cacheable_by_default_statuses = {
|
105 |
+
200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501
|
106 |
+
}
|
107 |
+
|
108 |
+
def update_headers(self, resp):
|
109 |
+
headers = resp.headers
|
110 |
+
|
111 |
+
if "expires" in headers:
|
112 |
+
return {}
|
113 |
+
|
114 |
+
if "cache-control" in headers and headers["cache-control"] != "public":
|
115 |
+
return {}
|
116 |
+
|
117 |
+
if resp.status not in self.cacheable_by_default_statuses:
|
118 |
+
return {}
|
119 |
+
|
120 |
+
if "date" not in headers or "last-modified" not in headers:
|
121 |
+
return {}
|
122 |
+
|
123 |
+
date = calendar.timegm(parsedate_tz(headers["date"]))
|
124 |
+
last_modified = parsedate(headers["last-modified"])
|
125 |
+
if date is None or last_modified is None:
|
126 |
+
return {}
|
127 |
+
|
128 |
+
now = time.time()
|
129 |
+
current_age = max(0, now - date)
|
130 |
+
delta = date - calendar.timegm(last_modified)
|
131 |
+
freshness_lifetime = max(0, min(delta / 10, 24 * 3600))
|
132 |
+
if freshness_lifetime <= current_age:
|
133 |
+
return {}
|
134 |
+
|
135 |
+
expires = date + freshness_lifetime
|
136 |
+
return {"expires": time.strftime(TIME_FMT, time.gmtime(expires))}
|
137 |
+
|
138 |
+
def warning(self, resp):
|
139 |
+
return None
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/serialize.py
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
import base64
|
6 |
+
import io
|
7 |
+
import json
|
8 |
+
import zlib
|
9 |
+
|
10 |
+
from pip._vendor import msgpack
|
11 |
+
from pip._vendor.requests.structures import CaseInsensitiveDict
|
12 |
+
|
13 |
+
from .compat import HTTPResponse, pickle, text_type
|
14 |
+
|
15 |
+
|
16 |
+
def _b64_decode_bytes(b):
|
17 |
+
return base64.b64decode(b.encode("ascii"))
|
18 |
+
|
19 |
+
|
20 |
+
def _b64_decode_str(s):
|
21 |
+
return _b64_decode_bytes(s).decode("utf8")
|
22 |
+
|
23 |
+
|
24 |
+
_default_body_read = object()
|
25 |
+
|
26 |
+
|
27 |
+
class Serializer(object):
|
28 |
+
def dumps(self, request, response, body=None):
|
29 |
+
response_headers = CaseInsensitiveDict(response.headers)
|
30 |
+
|
31 |
+
if body is None:
|
32 |
+
# When a body isn't passed in, we'll read the response. We
|
33 |
+
# also update the response with a new file handler to be
|
34 |
+
# sure it acts as though it was never read.
|
35 |
+
body = response.read(decode_content=False)
|
36 |
+
response._fp = io.BytesIO(body)
|
37 |
+
|
38 |
+
# NOTE: This is all a bit weird, but it's really important that on
|
39 |
+
# Python 2.x these objects are unicode and not str, even when
|
40 |
+
# they contain only ascii. The problem here is that msgpack
|
41 |
+
# understands the difference between unicode and bytes and we
|
42 |
+
# have it set to differentiate between them, however Python 2
|
43 |
+
# doesn't know the difference. Forcing these to unicode will be
|
44 |
+
# enough to have msgpack know the difference.
|
45 |
+
data = {
|
46 |
+
u"response": {
|
47 |
+
u"body": body,
|
48 |
+
u"headers": dict(
|
49 |
+
(text_type(k), text_type(v)) for k, v in response.headers.items()
|
50 |
+
),
|
51 |
+
u"status": response.status,
|
52 |
+
u"version": response.version,
|
53 |
+
u"reason": text_type(response.reason),
|
54 |
+
u"strict": response.strict,
|
55 |
+
u"decode_content": response.decode_content,
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
# Construct our vary headers
|
60 |
+
data[u"vary"] = {}
|
61 |
+
if u"vary" in response_headers:
|
62 |
+
varied_headers = response_headers[u"vary"].split(",")
|
63 |
+
for header in varied_headers:
|
64 |
+
header = text_type(header).strip()
|
65 |
+
header_value = request.headers.get(header, None)
|
66 |
+
if header_value is not None:
|
67 |
+
header_value = text_type(header_value)
|
68 |
+
data[u"vary"][header] = header_value
|
69 |
+
|
70 |
+
return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)])
|
71 |
+
|
72 |
+
def loads(self, request, data):
|
73 |
+
# Short circuit if we've been given an empty set of data
|
74 |
+
if not data:
|
75 |
+
return
|
76 |
+
|
77 |
+
# Determine what version of the serializer the data was serialized
|
78 |
+
# with
|
79 |
+
try:
|
80 |
+
ver, data = data.split(b",", 1)
|
81 |
+
except ValueError:
|
82 |
+
ver = b"cc=0"
|
83 |
+
|
84 |
+
# Make sure that our "ver" is actually a version and isn't a false
|
85 |
+
# positive from a , being in the data stream.
|
86 |
+
if ver[:3] != b"cc=":
|
87 |
+
data = ver + data
|
88 |
+
ver = b"cc=0"
|
89 |
+
|
90 |
+
# Get the version number out of the cc=N
|
91 |
+
ver = ver.split(b"=", 1)[-1].decode("ascii")
|
92 |
+
|
93 |
+
# Dispatch to the actual load method for the given version
|
94 |
+
try:
|
95 |
+
return getattr(self, "_loads_v{}".format(ver))(request, data)
|
96 |
+
|
97 |
+
except AttributeError:
|
98 |
+
# This is a version we don't have a loads function for, so we'll
|
99 |
+
# just treat it as a miss and return None
|
100 |
+
return
|
101 |
+
|
102 |
+
def prepare_response(self, request, cached):
|
103 |
+
"""Verify our vary headers match and construct a real urllib3
|
104 |
+
HTTPResponse object.
|
105 |
+
"""
|
106 |
+
# Special case the '*' Vary value as it means we cannot actually
|
107 |
+
# determine if the cached response is suitable for this request.
|
108 |
+
# This case is also handled in the controller code when creating
|
109 |
+
# a cache entry, but is left here for backwards compatibility.
|
110 |
+
if "*" in cached.get("vary", {}):
|
111 |
+
return
|
112 |
+
|
113 |
+
# Ensure that the Vary headers for the cached response match our
|
114 |
+
# request
|
115 |
+
for header, value in cached.get("vary", {}).items():
|
116 |
+
if request.headers.get(header, None) != value:
|
117 |
+
return
|
118 |
+
|
119 |
+
body_raw = cached["response"].pop("body")
|
120 |
+
|
121 |
+
headers = CaseInsensitiveDict(data=cached["response"]["headers"])
|
122 |
+
if headers.get("transfer-encoding", "") == "chunked":
|
123 |
+
headers.pop("transfer-encoding")
|
124 |
+
|
125 |
+
cached["response"]["headers"] = headers
|
126 |
+
|
127 |
+
try:
|
128 |
+
body = io.BytesIO(body_raw)
|
129 |
+
except TypeError:
|
130 |
+
# This can happen if cachecontrol serialized to v1 format (pickle)
|
131 |
+
# using Python 2. A Python 2 str(byte string) will be unpickled as
|
132 |
+
# a Python 3 str (unicode string), which will cause the above to
|
133 |
+
# fail with:
|
134 |
+
#
|
135 |
+
# TypeError: 'str' does not support the buffer interface
|
136 |
+
body = io.BytesIO(body_raw.encode("utf8"))
|
137 |
+
|
138 |
+
return HTTPResponse(body=body, preload_content=False, **cached["response"])
|
139 |
+
|
140 |
+
def _loads_v0(self, request, data):
|
141 |
+
# The original legacy cache data. This doesn't contain enough
|
142 |
+
# information to construct everything we need, so we'll treat this as
|
143 |
+
# a miss.
|
144 |
+
return
|
145 |
+
|
146 |
+
def _loads_v1(self, request, data):
|
147 |
+
try:
|
148 |
+
cached = pickle.loads(data)
|
149 |
+
except ValueError:
|
150 |
+
return
|
151 |
+
|
152 |
+
return self.prepare_response(request, cached)
|
153 |
+
|
154 |
+
def _loads_v2(self, request, data):
|
155 |
+
try:
|
156 |
+
cached = json.loads(zlib.decompress(data).decode("utf8"))
|
157 |
+
except (ValueError, zlib.error):
|
158 |
+
return
|
159 |
+
|
160 |
+
# We need to decode the items that we've base64 encoded
|
161 |
+
cached["response"]["body"] = _b64_decode_bytes(cached["response"]["body"])
|
162 |
+
cached["response"]["headers"] = dict(
|
163 |
+
(_b64_decode_str(k), _b64_decode_str(v))
|
164 |
+
for k, v in cached["response"]["headers"].items()
|
165 |
+
)
|
166 |
+
cached["response"]["reason"] = _b64_decode_str(cached["response"]["reason"])
|
167 |
+
cached["vary"] = dict(
|
168 |
+
(_b64_decode_str(k), _b64_decode_str(v) if v is not None else v)
|
169 |
+
for k, v in cached["vary"].items()
|
170 |
+
)
|
171 |
+
|
172 |
+
return self.prepare_response(request, cached)
|
173 |
+
|
174 |
+
def _loads_v3(self, request, data):
|
175 |
+
# Due to Python 2 encoding issues, it's impossible to know for sure
|
176 |
+
# exactly how to load v3 entries, thus we'll treat these as a miss so
|
177 |
+
# that they get rewritten out as v4 entries.
|
178 |
+
return
|
179 |
+
|
180 |
+
def _loads_v4(self, request, data):
|
181 |
+
try:
|
182 |
+
cached = msgpack.loads(data, raw=False)
|
183 |
+
except ValueError:
|
184 |
+
return
|
185 |
+
|
186 |
+
return self.prepare_response(request, cached)
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/cachecontrol/wrapper.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
+
#
|
3 |
+
# SPDX-License-Identifier: Apache-2.0
|
4 |
+
|
5 |
+
from .adapter import CacheControlAdapter
|
6 |
+
from .cache import DictCache
|
7 |
+
|
8 |
+
|
9 |
+
def CacheControl(
|
10 |
+
sess,
|
11 |
+
cache=None,
|
12 |
+
cache_etags=True,
|
13 |
+
serializer=None,
|
14 |
+
heuristic=None,
|
15 |
+
controller_class=None,
|
16 |
+
adapter_class=None,
|
17 |
+
cacheable_methods=None,
|
18 |
+
):
|
19 |
+
|
20 |
+
cache = DictCache() if cache is None else cache
|
21 |
+
adapter_class = adapter_class or CacheControlAdapter
|
22 |
+
adapter = adapter_class(
|
23 |
+
cache,
|
24 |
+
cache_etags=cache_etags,
|
25 |
+
serializer=serializer,
|
26 |
+
heuristic=heuristic,
|
27 |
+
controller_class=controller_class,
|
28 |
+
cacheable_methods=cacheable_methods,
|
29 |
+
)
|
30 |
+
sess.mount("http://", adapter)
|
31 |
+
sess.mount("https://", adapter)
|
32 |
+
|
33 |
+
return sess
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/big5prober.py
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Communicator client code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .mbcharsetprober import MultiByteCharSetProber
|
29 |
+
from .codingstatemachine import CodingStateMachine
|
30 |
+
from .chardistribution import Big5DistributionAnalysis
|
31 |
+
from .mbcssm import BIG5_SM_MODEL
|
32 |
+
|
33 |
+
|
34 |
+
class Big5Prober(MultiByteCharSetProber):
|
35 |
+
def __init__(self):
|
36 |
+
super(Big5Prober, self).__init__()
|
37 |
+
self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
|
38 |
+
self.distribution_analyzer = Big5DistributionAnalysis()
|
39 |
+
self.reset()
|
40 |
+
|
41 |
+
@property
|
42 |
+
def charset_name(self):
|
43 |
+
return "Big5"
|
44 |
+
|
45 |
+
@property
|
46 |
+
def language(self):
|
47 |
+
return "Chinese"
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/chardistribution.py
ADDED
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Communicator client code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .euctwfreq import (EUCTW_CHAR_TO_FREQ_ORDER, EUCTW_TABLE_SIZE,
|
29 |
+
EUCTW_TYPICAL_DISTRIBUTION_RATIO)
|
30 |
+
from .euckrfreq import (EUCKR_CHAR_TO_FREQ_ORDER, EUCKR_TABLE_SIZE,
|
31 |
+
EUCKR_TYPICAL_DISTRIBUTION_RATIO)
|
32 |
+
from .gb2312freq import (GB2312_CHAR_TO_FREQ_ORDER, GB2312_TABLE_SIZE,
|
33 |
+
GB2312_TYPICAL_DISTRIBUTION_RATIO)
|
34 |
+
from .big5freq import (BIG5_CHAR_TO_FREQ_ORDER, BIG5_TABLE_SIZE,
|
35 |
+
BIG5_TYPICAL_DISTRIBUTION_RATIO)
|
36 |
+
from .jisfreq import (JIS_CHAR_TO_FREQ_ORDER, JIS_TABLE_SIZE,
|
37 |
+
JIS_TYPICAL_DISTRIBUTION_RATIO)
|
38 |
+
|
39 |
+
|
40 |
+
class CharDistributionAnalysis(object):
|
41 |
+
ENOUGH_DATA_THRESHOLD = 1024
|
42 |
+
SURE_YES = 0.99
|
43 |
+
SURE_NO = 0.01
|
44 |
+
MINIMUM_DATA_THRESHOLD = 3
|
45 |
+
|
46 |
+
def __init__(self):
|
47 |
+
# Mapping table to get frequency order from char order (get from
|
48 |
+
# GetOrder())
|
49 |
+
self._char_to_freq_order = None
|
50 |
+
self._table_size = None # Size of above table
|
51 |
+
# This is a constant value which varies from language to language,
|
52 |
+
# used in calculating confidence. See
|
53 |
+
# http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html
|
54 |
+
# for further detail.
|
55 |
+
self.typical_distribution_ratio = None
|
56 |
+
self._done = None
|
57 |
+
self._total_chars = None
|
58 |
+
self._freq_chars = None
|
59 |
+
self.reset()
|
60 |
+
|
61 |
+
def reset(self):
|
62 |
+
"""reset analyser, clear any state"""
|
63 |
+
# If this flag is set to True, detection is done and conclusion has
|
64 |
+
# been made
|
65 |
+
self._done = False
|
66 |
+
self._total_chars = 0 # Total characters encountered
|
67 |
+
# The number of characters whose frequency order is less than 512
|
68 |
+
self._freq_chars = 0
|
69 |
+
|
70 |
+
def feed(self, char, char_len):
|
71 |
+
"""feed a character with known length"""
|
72 |
+
if char_len == 2:
|
73 |
+
# we only care about 2-bytes character in our distribution analysis
|
74 |
+
order = self.get_order(char)
|
75 |
+
else:
|
76 |
+
order = -1
|
77 |
+
if order >= 0:
|
78 |
+
self._total_chars += 1
|
79 |
+
# order is valid
|
80 |
+
if order < self._table_size:
|
81 |
+
if 512 > self._char_to_freq_order[order]:
|
82 |
+
self._freq_chars += 1
|
83 |
+
|
84 |
+
def get_confidence(self):
|
85 |
+
"""return confidence based on existing data"""
|
86 |
+
# if we didn't receive any character in our consideration range,
|
87 |
+
# return negative answer
|
88 |
+
if self._total_chars <= 0 or self._freq_chars <= self.MINIMUM_DATA_THRESHOLD:
|
89 |
+
return self.SURE_NO
|
90 |
+
|
91 |
+
if self._total_chars != self._freq_chars:
|
92 |
+
r = (self._freq_chars / ((self._total_chars - self._freq_chars)
|
93 |
+
* self.typical_distribution_ratio))
|
94 |
+
if r < self.SURE_YES:
|
95 |
+
return r
|
96 |
+
|
97 |
+
# normalize confidence (we don't want to be 100% sure)
|
98 |
+
return self.SURE_YES
|
99 |
+
|
100 |
+
def got_enough_data(self):
|
101 |
+
# It is not necessary to receive all data to draw conclusion.
|
102 |
+
# For charset detection, certain amount of data is enough
|
103 |
+
return self._total_chars > self.ENOUGH_DATA_THRESHOLD
|
104 |
+
|
105 |
+
def get_order(self, byte_str):
|
106 |
+
# We do not handle characters based on the original encoding string,
|
107 |
+
# but convert this encoding string to a number, here called order.
|
108 |
+
# This allows multiple encodings of a language to share one frequency
|
109 |
+
# table.
|
110 |
+
return -1
|
111 |
+
|
112 |
+
|
113 |
+
class EUCTWDistributionAnalysis(CharDistributionAnalysis):
|
114 |
+
def __init__(self):
|
115 |
+
super(EUCTWDistributionAnalysis, self).__init__()
|
116 |
+
self._char_to_freq_order = EUCTW_CHAR_TO_FREQ_ORDER
|
117 |
+
self._table_size = EUCTW_TABLE_SIZE
|
118 |
+
self.typical_distribution_ratio = EUCTW_TYPICAL_DISTRIBUTION_RATIO
|
119 |
+
|
120 |
+
def get_order(self, byte_str):
|
121 |
+
# for euc-TW encoding, we are interested
|
122 |
+
# first byte range: 0xc4 -- 0xfe
|
123 |
+
# second byte range: 0xa1 -- 0xfe
|
124 |
+
# no validation needed here. State machine has done that
|
125 |
+
first_char = byte_str[0]
|
126 |
+
if first_char >= 0xC4:
|
127 |
+
return 94 * (first_char - 0xC4) + byte_str[1] - 0xA1
|
128 |
+
else:
|
129 |
+
return -1
|
130 |
+
|
131 |
+
|
132 |
+
class EUCKRDistributionAnalysis(CharDistributionAnalysis):
|
133 |
+
def __init__(self):
|
134 |
+
super(EUCKRDistributionAnalysis, self).__init__()
|
135 |
+
self._char_to_freq_order = EUCKR_CHAR_TO_FREQ_ORDER
|
136 |
+
self._table_size = EUCKR_TABLE_SIZE
|
137 |
+
self.typical_distribution_ratio = EUCKR_TYPICAL_DISTRIBUTION_RATIO
|
138 |
+
|
139 |
+
def get_order(self, byte_str):
|
140 |
+
# for euc-KR encoding, we are interested
|
141 |
+
# first byte range: 0xb0 -- 0xfe
|
142 |
+
# second byte range: 0xa1 -- 0xfe
|
143 |
+
# no validation needed here. State machine has done that
|
144 |
+
first_char = byte_str[0]
|
145 |
+
if first_char >= 0xB0:
|
146 |
+
return 94 * (first_char - 0xB0) + byte_str[1] - 0xA1
|
147 |
+
else:
|
148 |
+
return -1
|
149 |
+
|
150 |
+
|
151 |
+
class GB2312DistributionAnalysis(CharDistributionAnalysis):
|
152 |
+
def __init__(self):
|
153 |
+
super(GB2312DistributionAnalysis, self).__init__()
|
154 |
+
self._char_to_freq_order = GB2312_CHAR_TO_FREQ_ORDER
|
155 |
+
self._table_size = GB2312_TABLE_SIZE
|
156 |
+
self.typical_distribution_ratio = GB2312_TYPICAL_DISTRIBUTION_RATIO
|
157 |
+
|
158 |
+
def get_order(self, byte_str):
|
159 |
+
# for GB2312 encoding, we are interested
|
160 |
+
# first byte range: 0xb0 -- 0xfe
|
161 |
+
# second byte range: 0xa1 -- 0xfe
|
162 |
+
# no validation needed here. State machine has done that
|
163 |
+
first_char, second_char = byte_str[0], byte_str[1]
|
164 |
+
if (first_char >= 0xB0) and (second_char >= 0xA1):
|
165 |
+
return 94 * (first_char - 0xB0) + second_char - 0xA1
|
166 |
+
else:
|
167 |
+
return -1
|
168 |
+
|
169 |
+
|
170 |
+
class Big5DistributionAnalysis(CharDistributionAnalysis):
|
171 |
+
def __init__(self):
|
172 |
+
super(Big5DistributionAnalysis, self).__init__()
|
173 |
+
self._char_to_freq_order = BIG5_CHAR_TO_FREQ_ORDER
|
174 |
+
self._table_size = BIG5_TABLE_SIZE
|
175 |
+
self.typical_distribution_ratio = BIG5_TYPICAL_DISTRIBUTION_RATIO
|
176 |
+
|
177 |
+
def get_order(self, byte_str):
|
178 |
+
# for big5 encoding, we are interested
|
179 |
+
# first byte range: 0xa4 -- 0xfe
|
180 |
+
# second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe
|
181 |
+
# no validation needed here. State machine has done that
|
182 |
+
first_char, second_char = byte_str[0], byte_str[1]
|
183 |
+
if first_char >= 0xA4:
|
184 |
+
if second_char >= 0xA1:
|
185 |
+
return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63
|
186 |
+
else:
|
187 |
+
return 157 * (first_char - 0xA4) + second_char - 0x40
|
188 |
+
else:
|
189 |
+
return -1
|
190 |
+
|
191 |
+
|
192 |
+
class SJISDistributionAnalysis(CharDistributionAnalysis):
|
193 |
+
def __init__(self):
|
194 |
+
super(SJISDistributionAnalysis, self).__init__()
|
195 |
+
self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER
|
196 |
+
self._table_size = JIS_TABLE_SIZE
|
197 |
+
self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO
|
198 |
+
|
199 |
+
def get_order(self, byte_str):
|
200 |
+
# for sjis encoding, we are interested
|
201 |
+
# first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe
|
202 |
+
# second byte range: 0x40 -- 0x7e, 0x81 -- oxfe
|
203 |
+
# no validation needed here. State machine has done that
|
204 |
+
first_char, second_char = byte_str[0], byte_str[1]
|
205 |
+
if (first_char >= 0x81) and (first_char <= 0x9F):
|
206 |
+
order = 188 * (first_char - 0x81)
|
207 |
+
elif (first_char >= 0xE0) and (first_char <= 0xEF):
|
208 |
+
order = 188 * (first_char - 0xE0 + 31)
|
209 |
+
else:
|
210 |
+
return -1
|
211 |
+
order = order + second_char - 0x40
|
212 |
+
if second_char > 0x7F:
|
213 |
+
order = -1
|
214 |
+
return order
|
215 |
+
|
216 |
+
|
217 |
+
class EUCJPDistributionAnalysis(CharDistributionAnalysis):
|
218 |
+
def __init__(self):
|
219 |
+
super(EUCJPDistributionAnalysis, self).__init__()
|
220 |
+
self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER
|
221 |
+
self._table_size = JIS_TABLE_SIZE
|
222 |
+
self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO
|
223 |
+
|
224 |
+
def get_order(self, byte_str):
|
225 |
+
# for euc-JP encoding, we are interested
|
226 |
+
# first byte range: 0xa0 -- 0xfe
|
227 |
+
# second byte range: 0xa1 -- 0xfe
|
228 |
+
# no validation needed here. State machine has done that
|
229 |
+
char = byte_str[0]
|
230 |
+
if char >= 0xA0:
|
231 |
+
return 94 * (char - 0xA1) + byte_str[1] - 0xa1
|
232 |
+
else:
|
233 |
+
return -1
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/codingstatemachine.py
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is mozilla.org code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
import logging
|
29 |
+
|
30 |
+
from .enums import MachineState
|
31 |
+
|
32 |
+
|
33 |
+
class CodingStateMachine(object):
|
34 |
+
"""
|
35 |
+
A state machine to verify a byte sequence for a particular encoding. For
|
36 |
+
each byte the detector receives, it will feed that byte to every active
|
37 |
+
state machine available, one byte at a time. The state machine changes its
|
38 |
+
state based on its previous state and the byte it receives. There are 3
|
39 |
+
states in a state machine that are of interest to an auto-detector:
|
40 |
+
|
41 |
+
START state: This is the state to start with, or a legal byte sequence
|
42 |
+
(i.e. a valid code point) for character has been identified.
|
43 |
+
|
44 |
+
ME state: This indicates that the state machine identified a byte sequence
|
45 |
+
that is specific to the charset it is designed for and that
|
46 |
+
there is no other possible encoding which can contain this byte
|
47 |
+
sequence. This will to lead to an immediate positive answer for
|
48 |
+
the detector.
|
49 |
+
|
50 |
+
ERROR state: This indicates the state machine identified an illegal byte
|
51 |
+
sequence for that encoding. This will lead to an immediate
|
52 |
+
negative answer for this encoding. Detector will exclude this
|
53 |
+
encoding from consideration from here on.
|
54 |
+
"""
|
55 |
+
def __init__(self, sm):
|
56 |
+
self._model = sm
|
57 |
+
self._curr_byte_pos = 0
|
58 |
+
self._curr_char_len = 0
|
59 |
+
self._curr_state = None
|
60 |
+
self.logger = logging.getLogger(__name__)
|
61 |
+
self.reset()
|
62 |
+
|
63 |
+
def reset(self):
|
64 |
+
self._curr_state = MachineState.START
|
65 |
+
|
66 |
+
def next_state(self, c):
|
67 |
+
# for each byte we get its class
|
68 |
+
# if it is first byte, we also get byte length
|
69 |
+
byte_class = self._model['class_table'][c]
|
70 |
+
if self._curr_state == MachineState.START:
|
71 |
+
self._curr_byte_pos = 0
|
72 |
+
self._curr_char_len = self._model['char_len_table'][byte_class]
|
73 |
+
# from byte's class and state_table, we get its next state
|
74 |
+
curr_state = (self._curr_state * self._model['class_factor']
|
75 |
+
+ byte_class)
|
76 |
+
self._curr_state = self._model['state_table'][curr_state]
|
77 |
+
self._curr_byte_pos += 1
|
78 |
+
return self._curr_state
|
79 |
+
|
80 |
+
def get_current_charlen(self):
|
81 |
+
return self._curr_char_len
|
82 |
+
|
83 |
+
def get_coding_state_machine(self):
|
84 |
+
return self._model['name']
|
85 |
+
|
86 |
+
@property
|
87 |
+
def language(self):
|
88 |
+
return self._model['language']
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# Contributor(s):
|
3 |
+
# Dan Blanchard
|
4 |
+
# Ian Cordasco
|
5 |
+
#
|
6 |
+
# This library is free software; you can redistribute it and/or
|
7 |
+
# modify it under the terms of the GNU Lesser General Public
|
8 |
+
# License as published by the Free Software Foundation; either
|
9 |
+
# version 2.1 of the License, or (at your option) any later version.
|
10 |
+
#
|
11 |
+
# This library is distributed in the hope that it will be useful,
|
12 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
+
# Lesser General Public License for more details.
|
15 |
+
#
|
16 |
+
# You should have received a copy of the GNU Lesser General Public
|
17 |
+
# License along with this library; if not, write to the Free Software
|
18 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
19 |
+
# 02110-1301 USA
|
20 |
+
######################### END LICENSE BLOCK #########################
|
21 |
+
|
22 |
+
import sys
|
23 |
+
|
24 |
+
|
25 |
+
if sys.version_info < (3, 0):
|
26 |
+
PY2 = True
|
27 |
+
PY3 = False
|
28 |
+
string_types = (str, unicode)
|
29 |
+
text_type = unicode
|
30 |
+
iteritems = dict.iteritems
|
31 |
+
else:
|
32 |
+
PY2 = False
|
33 |
+
PY3 = True
|
34 |
+
string_types = (bytes, str)
|
35 |
+
text_type = str
|
36 |
+
iteritems = dict.items
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/escsm.py
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .enums import MachineState
|
29 |
+
|
30 |
+
HZ_CLS = (
|
31 |
+
1,0,0,0,0,0,0,0, # 00 - 07
|
32 |
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
33 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
34 |
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
35 |
+
0,0,0,0,0,0,0,0, # 20 - 27
|
36 |
+
0,0,0,0,0,0,0,0, # 28 - 2f
|
37 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
38 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
39 |
+
0,0,0,0,0,0,0,0, # 40 - 47
|
40 |
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
41 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
42 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
43 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
44 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
45 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
46 |
+
0,0,0,4,0,5,2,0, # 78 - 7f
|
47 |
+
1,1,1,1,1,1,1,1, # 80 - 87
|
48 |
+
1,1,1,1,1,1,1,1, # 88 - 8f
|
49 |
+
1,1,1,1,1,1,1,1, # 90 - 97
|
50 |
+
1,1,1,1,1,1,1,1, # 98 - 9f
|
51 |
+
1,1,1,1,1,1,1,1, # a0 - a7
|
52 |
+
1,1,1,1,1,1,1,1, # a8 - af
|
53 |
+
1,1,1,1,1,1,1,1, # b0 - b7
|
54 |
+
1,1,1,1,1,1,1,1, # b8 - bf
|
55 |
+
1,1,1,1,1,1,1,1, # c0 - c7
|
56 |
+
1,1,1,1,1,1,1,1, # c8 - cf
|
57 |
+
1,1,1,1,1,1,1,1, # d0 - d7
|
58 |
+
1,1,1,1,1,1,1,1, # d8 - df
|
59 |
+
1,1,1,1,1,1,1,1, # e0 - e7
|
60 |
+
1,1,1,1,1,1,1,1, # e8 - ef
|
61 |
+
1,1,1,1,1,1,1,1, # f0 - f7
|
62 |
+
1,1,1,1,1,1,1,1, # f8 - ff
|
63 |
+
)
|
64 |
+
|
65 |
+
HZ_ST = (
|
66 |
+
MachineState.START,MachineState.ERROR, 3,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07
|
67 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f
|
68 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START, 4,MachineState.ERROR,# 10-17
|
69 |
+
5,MachineState.ERROR, 6,MachineState.ERROR, 5, 5, 4,MachineState.ERROR,# 18-1f
|
70 |
+
4,MachineState.ERROR, 4, 4, 4,MachineState.ERROR, 4,MachineState.ERROR,# 20-27
|
71 |
+
4,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 28-2f
|
72 |
+
)
|
73 |
+
|
74 |
+
HZ_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0)
|
75 |
+
|
76 |
+
HZ_SM_MODEL = {'class_table': HZ_CLS,
|
77 |
+
'class_factor': 6,
|
78 |
+
'state_table': HZ_ST,
|
79 |
+
'char_len_table': HZ_CHAR_LEN_TABLE,
|
80 |
+
'name': "HZ-GB-2312",
|
81 |
+
'language': 'Chinese'}
|
82 |
+
|
83 |
+
ISO2022CN_CLS = (
|
84 |
+
2,0,0,0,0,0,0,0, # 00 - 07
|
85 |
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
86 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
87 |
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
88 |
+
0,0,0,0,0,0,0,0, # 20 - 27
|
89 |
+
0,3,0,0,0,0,0,0, # 28 - 2f
|
90 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
91 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
92 |
+
0,0,0,4,0,0,0,0, # 40 - 47
|
93 |
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
94 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
95 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
96 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
97 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
98 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
99 |
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
100 |
+
2,2,2,2,2,2,2,2, # 80 - 87
|
101 |
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
102 |
+
2,2,2,2,2,2,2,2, # 90 - 97
|
103 |
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
104 |
+
2,2,2,2,2,2,2,2, # a0 - a7
|
105 |
+
2,2,2,2,2,2,2,2, # a8 - af
|
106 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
107 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
108 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
109 |
+
2,2,2,2,2,2,2,2, # c8 - cf
|
110 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
111 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
112 |
+
2,2,2,2,2,2,2,2, # e0 - e7
|
113 |
+
2,2,2,2,2,2,2,2, # e8 - ef
|
114 |
+
2,2,2,2,2,2,2,2, # f0 - f7
|
115 |
+
2,2,2,2,2,2,2,2, # f8 - ff
|
116 |
+
)
|
117 |
+
|
118 |
+
ISO2022CN_ST = (
|
119 |
+
MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07
|
120 |
+
MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f
|
121 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17
|
122 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,# 18-1f
|
123 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 20-27
|
124 |
+
5, 6,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 28-2f
|
125 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 30-37
|
126 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,# 38-3f
|
127 |
+
)
|
128 |
+
|
129 |
+
ISO2022CN_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0)
|
130 |
+
|
131 |
+
ISO2022CN_SM_MODEL = {'class_table': ISO2022CN_CLS,
|
132 |
+
'class_factor': 9,
|
133 |
+
'state_table': ISO2022CN_ST,
|
134 |
+
'char_len_table': ISO2022CN_CHAR_LEN_TABLE,
|
135 |
+
'name': "ISO-2022-CN",
|
136 |
+
'language': 'Chinese'}
|
137 |
+
|
138 |
+
ISO2022JP_CLS = (
|
139 |
+
2,0,0,0,0,0,0,0, # 00 - 07
|
140 |
+
0,0,0,0,0,0,2,2, # 08 - 0f
|
141 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
142 |
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
143 |
+
0,0,0,0,7,0,0,0, # 20 - 27
|
144 |
+
3,0,0,0,0,0,0,0, # 28 - 2f
|
145 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
146 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
147 |
+
6,0,4,0,8,0,0,0, # 40 - 47
|
148 |
+
0,9,5,0,0,0,0,0, # 48 - 4f
|
149 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
150 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
151 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
152 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
153 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
154 |
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
155 |
+
2,2,2,2,2,2,2,2, # 80 - 87
|
156 |
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
157 |
+
2,2,2,2,2,2,2,2, # 90 - 97
|
158 |
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
159 |
+
2,2,2,2,2,2,2,2, # a0 - a7
|
160 |
+
2,2,2,2,2,2,2,2, # a8 - af
|
161 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
162 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
163 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
164 |
+
2,2,2,2,2,2,2,2, # c8 - cf
|
165 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
166 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
167 |
+
2,2,2,2,2,2,2,2, # e0 - e7
|
168 |
+
2,2,2,2,2,2,2,2, # e8 - ef
|
169 |
+
2,2,2,2,2,2,2,2, # f0 - f7
|
170 |
+
2,2,2,2,2,2,2,2, # f8 - ff
|
171 |
+
)
|
172 |
+
|
173 |
+
ISO2022JP_ST = (
|
174 |
+
MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07
|
175 |
+
MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f
|
176 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17
|
177 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,# 18-1f
|
178 |
+
MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 20-27
|
179 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 6,MachineState.ITS_ME,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,# 28-2f
|
180 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,# 30-37
|
181 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 38-3f
|
182 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.START,# 40-47
|
183 |
+
)
|
184 |
+
|
185 |
+
ISO2022JP_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
186 |
+
|
187 |
+
ISO2022JP_SM_MODEL = {'class_table': ISO2022JP_CLS,
|
188 |
+
'class_factor': 10,
|
189 |
+
'state_table': ISO2022JP_ST,
|
190 |
+
'char_len_table': ISO2022JP_CHAR_LEN_TABLE,
|
191 |
+
'name': "ISO-2022-JP",
|
192 |
+
'language': 'Japanese'}
|
193 |
+
|
194 |
+
ISO2022KR_CLS = (
|
195 |
+
2,0,0,0,0,0,0,0, # 00 - 07
|
196 |
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
197 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
198 |
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
199 |
+
0,0,0,0,3,0,0,0, # 20 - 27
|
200 |
+
0,4,0,0,0,0,0,0, # 28 - 2f
|
201 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
202 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
203 |
+
0,0,0,5,0,0,0,0, # 40 - 47
|
204 |
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
205 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
206 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
207 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
208 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
209 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
210 |
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
211 |
+
2,2,2,2,2,2,2,2, # 80 - 87
|
212 |
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
213 |
+
2,2,2,2,2,2,2,2, # 90 - 97
|
214 |
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
215 |
+
2,2,2,2,2,2,2,2, # a0 - a7
|
216 |
+
2,2,2,2,2,2,2,2, # a8 - af
|
217 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
218 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
219 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
220 |
+
2,2,2,2,2,2,2,2, # c8 - cf
|
221 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
222 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
223 |
+
2,2,2,2,2,2,2,2, # e0 - e7
|
224 |
+
2,2,2,2,2,2,2,2, # e8 - ef
|
225 |
+
2,2,2,2,2,2,2,2, # f0 - f7
|
226 |
+
2,2,2,2,2,2,2,2, # f8 - ff
|
227 |
+
)
|
228 |
+
|
229 |
+
ISO2022KR_ST = (
|
230 |
+
MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07
|
231 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f
|
232 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 10-17
|
233 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 18-1f
|
234 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 20-27
|
235 |
+
)
|
236 |
+
|
237 |
+
ISO2022KR_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0)
|
238 |
+
|
239 |
+
ISO2022KR_SM_MODEL = {'class_table': ISO2022KR_CLS,
|
240 |
+
'class_factor': 6,
|
241 |
+
'state_table': ISO2022KR_ST,
|
242 |
+
'char_len_table': ISO2022KR_CHAR_LEN_TABLE,
|
243 |
+
'name': "ISO-2022-KR",
|
244 |
+
'language': 'Korean'}
|
245 |
+
|
246 |
+
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/eucjpprober.py
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is mozilla.org code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .enums import ProbingState, MachineState
|
29 |
+
from .mbcharsetprober import MultiByteCharSetProber
|
30 |
+
from .codingstatemachine import CodingStateMachine
|
31 |
+
from .chardistribution import EUCJPDistributionAnalysis
|
32 |
+
from .jpcntx import EUCJPContextAnalysis
|
33 |
+
from .mbcssm import EUCJP_SM_MODEL
|
34 |
+
|
35 |
+
|
36 |
+
class EUCJPProber(MultiByteCharSetProber):
|
37 |
+
def __init__(self):
|
38 |
+
super(EUCJPProber, self).__init__()
|
39 |
+
self.coding_sm = CodingStateMachine(EUCJP_SM_MODEL)
|
40 |
+
self.distribution_analyzer = EUCJPDistributionAnalysis()
|
41 |
+
self.context_analyzer = EUCJPContextAnalysis()
|
42 |
+
self.reset()
|
43 |
+
|
44 |
+
def reset(self):
|
45 |
+
super(EUCJPProber, self).reset()
|
46 |
+
self.context_analyzer.reset()
|
47 |
+
|
48 |
+
@property
|
49 |
+
def charset_name(self):
|
50 |
+
return "EUC-JP"
|
51 |
+
|
52 |
+
@property
|
53 |
+
def language(self):
|
54 |
+
return "Japanese"
|
55 |
+
|
56 |
+
def feed(self, byte_str):
|
57 |
+
for i in range(len(byte_str)):
|
58 |
+
# PY3K: byte_str is a byte array, so byte_str[i] is an int, not a byte
|
59 |
+
coding_state = self.coding_sm.next_state(byte_str[i])
|
60 |
+
if coding_state == MachineState.ERROR:
|
61 |
+
self.logger.debug('%s %s prober hit error at byte %s',
|
62 |
+
self.charset_name, self.language, i)
|
63 |
+
self._state = ProbingState.NOT_ME
|
64 |
+
break
|
65 |
+
elif coding_state == MachineState.ITS_ME:
|
66 |
+
self._state = ProbingState.FOUND_IT
|
67 |
+
break
|
68 |
+
elif coding_state == MachineState.START:
|
69 |
+
char_len = self.coding_sm.get_current_charlen()
|
70 |
+
if i == 0:
|
71 |
+
self._last_char[1] = byte_str[0]
|
72 |
+
self.context_analyzer.feed(self._last_char, char_len)
|
73 |
+
self.distribution_analyzer.feed(self._last_char, char_len)
|
74 |
+
else:
|
75 |
+
self.context_analyzer.feed(byte_str[i - 1:i + 1],
|
76 |
+
char_len)
|
77 |
+
self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
|
78 |
+
char_len)
|
79 |
+
|
80 |
+
self._last_char[0] = byte_str[-1]
|
81 |
+
|
82 |
+
if self.state == ProbingState.DETECTING:
|
83 |
+
if (self.context_analyzer.got_enough_data() and
|
84 |
+
(self.get_confidence() > self.SHORTCUT_THRESHOLD)):
|
85 |
+
self._state = ProbingState.FOUND_IT
|
86 |
+
|
87 |
+
return self.state
|
88 |
+
|
89 |
+
def get_confidence(self):
|
90 |
+
context_conf = self.context_analyzer.get_confidence()
|
91 |
+
distrib_conf = self.distribution_analyzer.get_confidence()
|
92 |
+
return max(context_conf, distrib_conf)
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312freq.py
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Communicator client code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
# GB2312 most frequently used character table
|
29 |
+
#
|
30 |
+
# Char to FreqOrder table , from hz6763
|
31 |
+
|
32 |
+
# 512 --> 0.79 -- 0.79
|
33 |
+
# 1024 --> 0.92 -- 0.13
|
34 |
+
# 2048 --> 0.98 -- 0.06
|
35 |
+
# 6768 --> 1.00 -- 0.02
|
36 |
+
#
|
37 |
+
# Ideal Distribution Ratio = 0.79135/(1-0.79135) = 3.79
|
38 |
+
# Random Distribution Ration = 512 / (3755 - 512) = 0.157
|
39 |
+
#
|
40 |
+
# Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR
|
41 |
+
|
42 |
+
GB2312_TYPICAL_DISTRIBUTION_RATIO = 0.9
|
43 |
+
|
44 |
+
GB2312_TABLE_SIZE = 3760
|
45 |
+
|
46 |
+
GB2312_CHAR_TO_FREQ_ORDER = (
|
47 |
+
1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205,
|
48 |
+
2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842,
|
49 |
+
2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409,
|
50 |
+
249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670,
|
51 |
+
1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820,
|
52 |
+
1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585,
|
53 |
+
152,1687,1539, 738,1559, 59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566,
|
54 |
+
1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850, 70,3285,2729,3534,3575,
|
55 |
+
2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853,
|
56 |
+
3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061,
|
57 |
+
544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155,
|
58 |
+
1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406,
|
59 |
+
927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,
|
60 |
+
2534,1546,2393,2760, 737,2494, 13, 447, 245,2747, 38,2765,2129,2589,1079, 606,
|
61 |
+
360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023,
|
62 |
+
2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414,
|
63 |
+
1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513,
|
64 |
+
3195,4115,5627,2489,2991, 24,2065,2697,1087,2719, 48,1634, 315, 68, 985,2052,
|
65 |
+
198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570,
|
66 |
+
1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575,
|
67 |
+
253,3099, 32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250,
|
68 |
+
2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506,
|
69 |
+
1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563, 26,
|
70 |
+
3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835,
|
71 |
+
1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686,
|
72 |
+
2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,
|
73 |
+
1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894,
|
74 |
+
585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105,
|
75 |
+
3777,3657, 643,2298,1148,1779, 190, 989,3544, 414, 11,2135,2063,2979,1471, 403,
|
76 |
+
3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694,
|
77 |
+
252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873,
|
78 |
+
3651, 210, 33,1608,2516, 200,1520, 415, 102, 0,3389,1287, 817, 91,3299,2940,
|
79 |
+
836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687, 20,1819, 121,
|
80 |
+
1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648,
|
81 |
+
3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992,
|
82 |
+
2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680, 72, 842,1990, 212,1233,
|
83 |
+
1154,1586, 75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157,
|
84 |
+
755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807,
|
85 |
+
1910, 534, 529,3309,1721,1660, 274, 39,2827, 661,2670,1578, 925,3248,3815,1094,
|
86 |
+
4278,4901,4252, 41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,
|
87 |
+
887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478,
|
88 |
+
3568, 194,5062, 15, 961,3870,1241,1192,2664, 66,5215,3260,2111,1295,1127,2152,
|
89 |
+
3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426, 53,2909,
|
90 |
+
509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272,
|
91 |
+
1272,2363, 284,1753,3679,4064,1695, 81, 815,2677,2757,2731,1386, 859, 500,4221,
|
92 |
+
2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252,
|
93 |
+
1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301,
|
94 |
+
1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254,
|
95 |
+
389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070,
|
96 |
+
3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461,
|
97 |
+
3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640, 67,2360,
|
98 |
+
4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124,
|
99 |
+
296,3979,1739,1611,3684, 23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535,
|
100 |
+
3116, 17,1074, 467,2692,2201, 387,2922, 45,1326,3055,1645,3659,2817, 958, 243,
|
101 |
+
1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713,
|
102 |
+
1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071,
|
103 |
+
4046,3572,2399,1571,3281, 79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442,
|
104 |
+
215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,
|
105 |
+
814,4968,3487,1548,2644,1567,1285, 2, 295,2636, 97, 946,3576, 832, 141,4257,
|
106 |
+
3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180,
|
107 |
+
1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427,
|
108 |
+
602,1525,2608,1605,1639,3175, 694,3064, 10, 465, 76,2000,4846,4208, 444,3781,
|
109 |
+
1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724,
|
110 |
+
2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844, 89, 937,
|
111 |
+
930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943,
|
112 |
+
432, 445,2811, 206,4136,1472, 730, 349, 73, 397,2802,2547, 998,1637,1167, 789,
|
113 |
+
396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552,
|
114 |
+
3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246,
|
115 |
+
4996, 371,1575,2436,1621,2210, 984,4033,1734,2638, 16,4529, 663,2755,3255,1451,
|
116 |
+
3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310,
|
117 |
+
750,2058, 165, 80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860,
|
118 |
+
2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297,
|
119 |
+
2357, 395,3740, 137,2075, 944,4089,2584,1267,3802, 62,1533,2285, 178, 176, 780,
|
120 |
+
2440, 201,3707, 590, 478,1560,4354,2117,1075, 30, 74,4643,4004,1635,1441,2745,
|
121 |
+
776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936,
|
122 |
+
2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032,
|
123 |
+
968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669, 43,2523,1657,
|
124 |
+
163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414,
|
125 |
+
220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976,
|
126 |
+
3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436,
|
127 |
+
2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254,
|
128 |
+
2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024, 40,3240,1536,
|
129 |
+
1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238,
|
130 |
+
18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059,
|
131 |
+
2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741,
|
132 |
+
90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447,
|
133 |
+
286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601,
|
134 |
+
1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269,
|
135 |
+
1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076, 46,4253,2873,1889,1894,
|
136 |
+
915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173,
|
137 |
+
681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994,
|
138 |
+
1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956,
|
139 |
+
2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437,
|
140 |
+
3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154,
|
141 |
+
2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240,
|
142 |
+
2269,2246,1446, 36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143,
|
143 |
+
2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634,
|
144 |
+
3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472,
|
145 |
+
1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906, 51, 369, 170,3541,
|
146 |
+
1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143,
|
147 |
+
2101,2730,2490, 82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312,
|
148 |
+
1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414,
|
149 |
+
3750,2289,2795, 813,3123,2610,1136,4368, 5,3391,4541,2174, 420, 429,1728, 754,
|
150 |
+
1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424,
|
151 |
+
1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302,
|
152 |
+
3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739,
|
153 |
+
795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,
|
154 |
+
2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484,
|
155 |
+
1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739,
|
156 |
+
4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535,
|
157 |
+
1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641,
|
158 |
+
1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,
|
159 |
+
3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573,
|
160 |
+
1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533,
|
161 |
+
47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,
|
162 |
+
504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096, 99,
|
163 |
+
1397,1769,2300,4428,1643,3455,1978,1757,3718,1440, 35,4879,3742,1296,4228,2280,
|
164 |
+
160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505,
|
165 |
+
1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012,
|
166 |
+
1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039,
|
167 |
+
744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982,
|
168 |
+
3708, 135,2131, 87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530,
|
169 |
+
4314, 9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,
|
170 |
+
3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656,
|
171 |
+
2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220,
|
172 |
+
2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766,
|
173 |
+
1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,
|
174 |
+
3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728,
|
175 |
+
2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338,
|
176 |
+
1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627,
|
177 |
+
1505,1911,1883,3526, 698,3629,3456,1833,1431, 746, 77,1261,2017,2296,1977,1885,
|
178 |
+
125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411,
|
179 |
+
2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671,
|
180 |
+
2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162,
|
181 |
+
3192,2910,2010, 140,2395,2859, 55,1082,2012,2901, 662, 419,2081,1438, 680,2774,
|
182 |
+
4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524,
|
183 |
+
3399, 98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,
|
184 |
+
180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040,
|
185 |
+
3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188,
|
186 |
+
2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280,
|
187 |
+
1086,1974,2034, 630, 257,3338,2788,4903,1017, 86,4790, 966,2789,1995,1696,1131,
|
188 |
+
259,3095,4188,1308, 179,1463,5257, 289,4107,1248, 42,3413,1725,2288, 896,1947,
|
189 |
+
774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970,
|
190 |
+
3034,3310, 540,2370,1562,1288,2990, 502,4765,1147, 4,1853,2708, 207, 294,2814,
|
191 |
+
4078,2902,2509, 684, 34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557,
|
192 |
+
2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997,
|
193 |
+
1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972,
|
194 |
+
1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369,
|
195 |
+
766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376,
|
196 |
+
1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196, 19, 941,3624,3480,
|
197 |
+
3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610,
|
198 |
+
955,1089,3103,1053, 96, 88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128,
|
199 |
+
642,4006, 903,2539,1877,2082, 596, 29,4066,1790, 722,2157, 130, 995,1569, 769,
|
200 |
+
1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445, 50, 625, 487,2207,
|
201 |
+
57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392,
|
202 |
+
1783, 362, 8,3433,3422, 610,2793,3277,1390,1284,1654, 21,3823, 734, 367, 623,
|
203 |
+
193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782,
|
204 |
+
2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650,
|
205 |
+
158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478,
|
206 |
+
2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773,
|
207 |
+
2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007,
|
208 |
+
1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323,
|
209 |
+
1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598,
|
210 |
+
2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961,
|
211 |
+
819,1541, 142,2284, 44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302,
|
212 |
+
1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409,
|
213 |
+
1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683,
|
214 |
+
2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191,
|
215 |
+
2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434, 92,1466,4920,2616,
|
216 |
+
3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302,
|
217 |
+
1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774,
|
218 |
+
4462, 64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147,
|
219 |
+
571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731,
|
220 |
+
845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464,
|
221 |
+
3264,2855,2722,1952,1029,2839,2467, 84,4383,2215, 820,1391,2015,2448,3672, 377,
|
222 |
+
1948,2168, 797,2545,3536,2578,2645, 94,2874,1678, 405,1259,3071, 771, 546,1315,
|
223 |
+
470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928, 14,2594, 557,
|
224 |
+
3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903,
|
225 |
+
1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060,
|
226 |
+
4031,2641,4067,3145,1870, 37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,
|
227 |
+
1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092,
|
228 |
+
2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810,
|
229 |
+
1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,
|
230 |
+
498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658,
|
231 |
+
1178,2639,2351, 93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871,
|
232 |
+
3341,1618,4126,2595,2334, 603, 651, 69, 701, 268,2662,3411,2555,1380,1606, 503,
|
233 |
+
448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229,
|
234 |
+
2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112,
|
235 |
+
136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504,
|
236 |
+
1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389,
|
237 |
+
1281, 52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169, 27,
|
238 |
+
1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542,
|
239 |
+
3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861,
|
240 |
+
2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845,
|
241 |
+
3891,2868,3621,2254, 58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700,
|
242 |
+
3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469,
|
243 |
+
3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582,
|
244 |
+
996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999,
|
245 |
+
2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274,
|
246 |
+
786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020,
|
247 |
+
2724,1927,2333,4440, 567, 22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601,
|
248 |
+
12, 974,3783,4391, 951,1412, 1,3720, 453,4608,4041, 528,1041,1027,3230,2628,
|
249 |
+
1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040, 31,
|
250 |
+
475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668,
|
251 |
+
233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778,
|
252 |
+
1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169,
|
253 |
+
3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667,
|
254 |
+
3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118, 63,2076, 314,1881,
|
255 |
+
1348,1061, 172, 978,3515,1747, 532, 511,3970, 6, 601, 905,2699,3300,1751, 276,
|
256 |
+
1467,3725,2668, 65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320,
|
257 |
+
3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751,
|
258 |
+
2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432,
|
259 |
+
2754, 95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772,
|
260 |
+
1985, 244,2546, 474, 495,1046,2611,1851,2061, 71,2089,1675,2590, 742,3758,2843,
|
261 |
+
3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116,
|
262 |
+
451, 3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904,
|
263 |
+
4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652,
|
264 |
+
1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,
|
265 |
+
2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078, 49,3770,
|
266 |
+
3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283,
|
267 |
+
3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626,
|
268 |
+
1197,1663,4476,3127, 85,4240,2528, 25,1111,1181,3673, 407,3470,4561,2679,2713,
|
269 |
+
768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333,
|
270 |
+
391,2963, 187, 61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062,
|
271 |
+
2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555,
|
272 |
+
931, 317,2517,3027, 325, 569, 686,2107,3084, 60,1042,1333,2794, 264,3177,4014,
|
273 |
+
1628, 258,3712, 7,4464,1176,1043,1778, 683, 114,1975, 78,1492, 383,1886, 510,
|
274 |
+
386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,
|
275 |
+
1282,1289,4609, 697,1453,3044,2666,3611,1856,2412, 54, 719,1330, 568,3778,2459,
|
276 |
+
1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390,
|
277 |
+
1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238,
|
278 |
+
1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421, 56,1908,1640,2387,2232,
|
279 |
+
1917,1874,2477,4921, 148, 83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624,
|
280 |
+
381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189,
|
281 |
+
852,1221,1400,1486, 882,2299,4036, 351, 28,1122, 700,6479,6480,6481,6482,6483, #last 512
|
282 |
+
)
|
283 |
+
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/jisfreq.py
ADDED
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Communicator client code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
# Sampling from about 20M text materials include literature and computer technology
|
29 |
+
#
|
30 |
+
# Japanese frequency table, applied to both S-JIS and EUC-JP
|
31 |
+
# They are sorted in order.
|
32 |
+
|
33 |
+
# 128 --> 0.77094
|
34 |
+
# 256 --> 0.85710
|
35 |
+
# 512 --> 0.92635
|
36 |
+
# 1024 --> 0.97130
|
37 |
+
# 2048 --> 0.99431
|
38 |
+
#
|
39 |
+
# Ideal Distribution Ratio = 0.92635 / (1-0.92635) = 12.58
|
40 |
+
# Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191
|
41 |
+
#
|
42 |
+
# Typical Distribution Ratio, 25% of IDR
|
43 |
+
|
44 |
+
JIS_TYPICAL_DISTRIBUTION_RATIO = 3.0
|
45 |
+
|
46 |
+
# Char to FreqOrder table ,
|
47 |
+
JIS_TABLE_SIZE = 4368
|
48 |
+
|
49 |
+
JIS_CHAR_TO_FREQ_ORDER = (
|
50 |
+
40, 1, 6, 182, 152, 180, 295,2127, 285, 381,3295,4304,3068,4606,3165,3510, # 16
|
51 |
+
3511,1822,2785,4607,1193,2226,5070,4608, 171,2996,1247, 18, 179,5071, 856,1661, # 32
|
52 |
+
1262,5072, 619, 127,3431,3512,3230,1899,1700, 232, 228,1294,1298, 284, 283,2041, # 48
|
53 |
+
2042,1061,1062, 48, 49, 44, 45, 433, 434,1040,1041, 996, 787,2997,1255,4305, # 64
|
54 |
+
2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928, # 80
|
55 |
+
5081,3296,3432, 290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375, # 96
|
56 |
+
1691,3297,4306,4307,4611, 452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086, # 112
|
57 |
+
5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102, # 128
|
58 |
+
5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117, # 144
|
59 |
+
5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133, # 160
|
60 |
+
5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149, # 176
|
61 |
+
5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164, # 192
|
62 |
+
5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472, 598, 618, 820,1205, # 208
|
63 |
+
1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172, # 224
|
64 |
+
1875,2043,2149,1793,1382,2973, 925,2404,1067,1241, 960,1377,2935,1491, 919,1217, # 240
|
65 |
+
1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804, # 256
|
66 |
+
2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998, # 272
|
67 |
+
3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161, 26,3377, 2,3929, 20, # 288
|
68 |
+
3691, 47,4100, 50, 17, 16, 35, 268, 27, 243, 42, 155, 24, 154, 29, 184, # 304
|
69 |
+
4, 91, 14, 92, 53, 396, 33, 289, 9, 37, 64, 620, 21, 39, 321, 5, # 320
|
70 |
+
12, 11, 52, 13, 3, 208, 138, 0, 7, 60, 526, 141, 151,1069, 181, 275, # 336
|
71 |
+
1591, 83, 132,1475, 126, 331, 829, 15, 69, 160, 59, 22, 157, 55,1079, 312, # 352
|
72 |
+
109, 38, 23, 25, 10, 19, 79,5195, 61, 382,1124, 8, 30,5196,5197,5198, # 368
|
73 |
+
5199,5200,5201,5202,5203,5204,5205,5206, 89, 62, 74, 34,2416, 112, 139, 196, # 384
|
74 |
+
271, 149, 84, 607, 131, 765, 46, 88, 153, 683, 76, 874, 101, 258, 57, 80, # 400
|
75 |
+
32, 364, 121,1508, 169,1547, 68, 235, 145,2999, 41, 360,3027, 70, 63, 31, # 416
|
76 |
+
43, 259, 262,1383, 99, 533, 194, 66, 93, 846, 217, 192, 56, 106, 58, 565, # 432
|
77 |
+
280, 272, 311, 256, 146, 82, 308, 71, 100, 128, 214, 655, 110, 261, 104,1140, # 448
|
78 |
+
54, 51, 36, 87, 67,3070, 185,2618,2936,2020, 28,1066,2390,2059,5207,5208, # 464
|
79 |
+
5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223, # 480
|
80 |
+
5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238, # 496
|
81 |
+
5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247, # 512
|
82 |
+
4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251, # 528
|
83 |
+
5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267, # 544
|
84 |
+
5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283, # 560
|
85 |
+
5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299, # 576
|
86 |
+
5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315, # 592
|
87 |
+
5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331, # 608
|
88 |
+
5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347, # 624
|
89 |
+
5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363, # 640
|
90 |
+
5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379, # 656
|
91 |
+
5380,5381, 363, 642,2787,2878,2788,2789,2316,3232,2317,3434,2011, 165,1942,3930, # 672
|
92 |
+
3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392, # 688
|
93 |
+
5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408, # 704
|
94 |
+
5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424, # 720
|
95 |
+
5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440, # 736
|
96 |
+
5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456, # 752
|
97 |
+
5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472, # 768
|
98 |
+
5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488, # 784
|
99 |
+
5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504, # 800
|
100 |
+
5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520, # 816
|
101 |
+
5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536, # 832
|
102 |
+
5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552, # 848
|
103 |
+
5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568, # 864
|
104 |
+
5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584, # 880
|
105 |
+
5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600, # 896
|
106 |
+
5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616, # 912
|
107 |
+
5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632, # 928
|
108 |
+
5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648, # 944
|
109 |
+
5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664, # 960
|
110 |
+
5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680, # 976
|
111 |
+
5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696, # 992
|
112 |
+
5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712, # 1008
|
113 |
+
5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728, # 1024
|
114 |
+
5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744, # 1040
|
115 |
+
5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760, # 1056
|
116 |
+
5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776, # 1072
|
117 |
+
5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792, # 1088
|
118 |
+
5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808, # 1104
|
119 |
+
5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824, # 1120
|
120 |
+
5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840, # 1136
|
121 |
+
5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856, # 1152
|
122 |
+
5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872, # 1168
|
123 |
+
5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888, # 1184
|
124 |
+
5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904, # 1200
|
125 |
+
5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920, # 1216
|
126 |
+
5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936, # 1232
|
127 |
+
5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952, # 1248
|
128 |
+
5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968, # 1264
|
129 |
+
5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984, # 1280
|
130 |
+
5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000, # 1296
|
131 |
+
6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016, # 1312
|
132 |
+
6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032, # 1328
|
133 |
+
6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048, # 1344
|
134 |
+
6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064, # 1360
|
135 |
+
6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080, # 1376
|
136 |
+
6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096, # 1392
|
137 |
+
6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112, # 1408
|
138 |
+
6113,6114,2044,2060,4621, 997,1235, 473,1186,4622, 920,3378,6115,6116, 379,1108, # 1424
|
139 |
+
4313,2657,2735,3934,6117,3809, 636,3233, 573,1026,3693,3435,2974,3300,2298,4105, # 1440
|
140 |
+
854,2937,2463, 393,2581,2417, 539, 752,1280,2750,2480, 140,1161, 440, 708,1569, # 1456
|
141 |
+
665,2497,1746,1291,1523,3000, 164,1603, 847,1331, 537,1997, 486, 508,1693,2418, # 1472
|
142 |
+
1970,2227, 878,1220, 299,1030, 969, 652,2751, 624,1137,3301,2619, 65,3302,2045, # 1488
|
143 |
+
1761,1859,3120,1930,3694,3516, 663,1767, 852, 835,3695, 269, 767,2826,2339,1305, # 1504
|
144 |
+
896,1150, 770,1616,6118, 506,1502,2075,1012,2519, 775,2520,2975,2340,2938,4314, # 1520
|
145 |
+
3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557, 175, 597, 985, # 1536
|
146 |
+
3517,2419,2521,1416,3029, 585, 938,1931,1007,1052,1932,1685,6120,3379,4316,4623, # 1552
|
147 |
+
804, 599,3121,1333,2128,2539,1159,1554,2032,3810, 687,2033,2904, 952, 675,1467, # 1568
|
148 |
+
3436,6121,2241,1096,1786,2440,1543,1924, 980,1813,2228, 781,2692,1879, 728,1918, # 1584
|
149 |
+
3696,4624, 548,1950,4625,1809,1088,1356,3303,2522,1944, 502, 972, 373, 513,2827, # 1600
|
150 |
+
586,2377,2391,1003,1976,1631,6122,2464,1084, 648,1776,4626,2141, 324, 962,2012, # 1616
|
151 |
+
2177,2076,1384, 742,2178,1448,1173,1810, 222, 102, 301, 445, 125,2420, 662,2498, # 1632
|
152 |
+
277, 200,1476,1165,1068, 224,2562,1378,1446, 450,1880, 659, 791, 582,4627,2939, # 1648
|
153 |
+
3936,1516,1274, 555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229, 412,2114, # 1664
|
154 |
+
1900,2392,3518, 512,2597, 427,1925,2341,3122,1653,1686,2465,2499, 697, 330, 273, # 1680
|
155 |
+
380,2162, 951, 832, 780, 991,1301,3073, 965,2270,3519, 668,2523,2636,1286, 535, # 1696
|
156 |
+
1407, 518, 671, 957,2658,2378, 267, 611,2197,3030,6123, 248,2299, 967,1799,2356, # 1712
|
157 |
+
850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879, # 1728
|
158 |
+
2829, 499,2179, 676,4629, 557,2329,2214,2090, 325,3234, 464, 811,3001, 992,2342, # 1744
|
159 |
+
2481,1232,1469, 303,2242, 466,1070,2163, 603,1777,2091,4630,2752,4631,2714, 322, # 1760
|
160 |
+
2659,1964,1768, 481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849, # 1776
|
161 |
+
2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634, # 1792
|
162 |
+
1604, 943,1724,1454, 917, 868,2215,1169,2940, 552,1145,1800,1228,1823,1955, 316, # 1808
|
163 |
+
1080,2510, 361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127, 541,1263,1229, # 1824
|
164 |
+
1148,2540, 545, 465,1833,2880,3438,1901,3074,2482, 816,3937, 713,1788,2500, 122, # 1840
|
165 |
+
1575, 195,1451,2501,1111,6128, 859, 374,1225,2243,2483,4317, 390,1033,3439,3075, # 1856
|
166 |
+
2524,1687, 266, 793,1440,2599, 946, 779, 802, 507, 897,1081, 528,2189,1292, 711, # 1872
|
167 |
+
1866,1725,1167,1640, 753, 398,2661,1053, 246, 348,4318, 137,1024,3440,1600,2077, # 1888
|
168 |
+
2129, 825,4319, 698, 238, 521, 187,2300,1157,2423,1641,1605,1464,1610,1097,2541, # 1904
|
169 |
+
1260,1436, 759,2255,1814,2150, 705,3235, 409,2563,3304, 561,3033,2005,2564, 726, # 1920
|
170 |
+
1956,2343,3698,4109, 949,3812,3813,3520,1669, 653,1379,2525, 881,2198, 632,2256, # 1936
|
171 |
+
1027, 778,1074, 733,1957, 514,1481,2466, 554,2180, 702,3938,1606,1017,1398,6129, # 1952
|
172 |
+
1380,3521, 921, 993,1313, 594, 449,1489,1617,1166, 768,1426,1360, 495,1794,3601, # 1968
|
173 |
+
1177,3602,1170,4320,2344, 476, 425,3167,4635,3168,1424, 401,2662,1171,3382,1998, # 1984
|
174 |
+
1089,4110, 477,3169, 474,6130,1909, 596,2831,1842, 494, 693,1051,1028,1207,3076, # 2000
|
175 |
+
606,2115, 727,2790,1473,1115, 743,3522, 630, 805,1532,4321,2021, 366,1057, 838, # 2016
|
176 |
+
684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090, # 2032
|
177 |
+
1536,3939,3523,3306,1455,2199, 336, 369,2331,1035, 584,2393, 902, 718,2600,6131, # 2048
|
178 |
+
2753, 463,2151,1149,1611,2467, 715,1308,3124,1268, 343,1413,3236,1517,1347,2663, # 2064
|
179 |
+
2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980, 872,2368, # 2080
|
180 |
+
2441,2943, 320,2369,2116,1082, 679,1933,3941,2791,3815, 625,1143,2023, 422,2200, # 2096
|
181 |
+
3816,6133, 730,1695, 356,2257,1626,2301,2858,2637,1627,1778, 937, 883,2906,2693, # 2112
|
182 |
+
3002,1769,1086, 400,1063,1325,3307,2792,4111,3077, 456,2345,1046, 747,6134,1524, # 2128
|
183 |
+
884,1094,3383,1474,2164,1059, 974,1688,2181,2258,1047, 345,1665,1187, 358, 875, # 2144
|
184 |
+
3170, 305, 660,3524,2190,1334,1135,3171,1540,1649,2542,1527, 927, 968,2793, 885, # 2160
|
185 |
+
1972,1850, 482, 500,2638,1218,1109,1085,2543,1654,2034, 876, 78,2287,1482,1277, # 2176
|
186 |
+
861,1675,1083,1779, 724,2754, 454, 397,1132,1612,2332, 893, 672,1237, 257,2259, # 2192
|
187 |
+
2370, 135,3384, 337,2244, 547, 352, 340, 709,2485,1400, 788,1138,2511, 540, 772, # 2208
|
188 |
+
1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533, 407, # 2224
|
189 |
+
576,3308,1254,2071, 978,3385, 170, 136,1201,3125,2664,3172,2394, 213, 912, 873, # 2240
|
190 |
+
3603,1713,2202, 699,3604,3699, 813,3442, 493, 531,1054, 468,2907,1483, 304, 281, # 2256
|
191 |
+
4112,1726,1252,2094, 339,2319,2130,2639, 756,1563,2944, 748, 571,2976,1588,2425, # 2272
|
192 |
+
2715,1851,1460,2426,1528,1392,1973,3237, 288,3309, 685,3386, 296, 892,2716,2216, # 2288
|
193 |
+
1570,2245, 722,1747,2217, 905,3238,1103,6135,1893,1441,1965, 251,1805,2371,3700, # 2304
|
194 |
+
2601,1919,1078, 75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817, 524, 706, # 2320
|
195 |
+
1075, 292,3818,1756,2602, 317, 98,3173,3605,3525,1844,2218,3819,2502, 814, 567, # 2336
|
196 |
+
385,2908,1534,6137, 534,1642,3239, 797,6138,1670,1529, 953,4323, 188,1071, 538, # 2352
|
197 |
+
178, 729,3240,2109,1226,1374,2000,2357,2977, 731,2468,1116,2014,2051,6139,1261, # 2368
|
198 |
+
1593, 803,2859,2736,3443, 556, 682, 823,1541,6140,1369,2289,1706,2794, 845, 462, # 2384
|
199 |
+
2603,2665,1361, 387, 162,2358,1740, 739,1770,1720,1304,1401,3241,1049, 627,1571, # 2400
|
200 |
+
2427,3526,1877,3942,1852,1500, 431,1910,1503, 677, 297,2795, 286,1433,1038,1198, # 2416
|
201 |
+
2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442, 108, 712,4640,2372, 866, # 2432
|
202 |
+
3701,2755,3242,1348, 834,1945,1408,3527,2395,3243,1811, 824, 994,1179,2110,1548, # 2448
|
203 |
+
1453, 790,3003, 690,4324,4325,2832,2909,3820,1860,3821, 225,1748, 310, 346,1780, # 2464
|
204 |
+
2470, 821,1993,2717,2796, 828, 877,3528,2860,2471,1702,2165,2910,2486,1789, 453, # 2480
|
205 |
+
359,2291,1676, 73,1164,1461,1127,3311, 421, 604, 314,1037, 589, 116,2487, 737, # 2496
|
206 |
+
837,1180, 111, 244, 735,6142,2261,1861,1362, 986, 523, 418, 581,2666,3822, 103, # 2512
|
207 |
+
855, 503,1414,1867,2488,1091, 657,1597, 979, 605,1316,4641,1021,2443,2078,2001, # 2528
|
208 |
+
1209, 96, 587,2166,1032, 260,1072,2153, 173, 94, 226,3244, 819,2006,4642,4114, # 2544
|
209 |
+
2203, 231,1744, 782, 97,2667, 786,3387, 887, 391, 442,2219,4326,1425,6143,2694, # 2560
|
210 |
+
633,1544,1202, 483,2015, 592,2052,1958,2472,1655, 419, 129,4327,3444,3312,1714, # 2576
|
211 |
+
1257,3078,4328,1518,1098, 865,1310,1019,1885,1512,1734, 469,2444, 148, 773, 436, # 2592
|
212 |
+
1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643, 579,1238, 932,2320, # 2608
|
213 |
+
353, 205, 801, 115,2428, 944,2321,1881, 399,2565,1211, 678, 766,3944, 335,2101, # 2624
|
214 |
+
1459,1781,1402,3945,2737,2131,1010, 844, 981,1326,1013, 550,1816,1545,2620,1335, # 2640
|
215 |
+
1008, 371,2881, 936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503, 416, # 2656
|
216 |
+
1643,4330, 806,1126, 229, 591,3946,1314,1981,1576,1837,1666, 347,1790, 977,3313, # 2672
|
217 |
+
764,2861,1853, 688,2429,1920,1462, 77, 595, 415,2002,3034, 798,1192,4115,6144, # 2688
|
218 |
+
2978,4331,3035,2695,2582,2072,2566, 430,2430,1727, 842,1396,3947,3702, 613, 377, # 2704
|
219 |
+
278, 236,1417,3388,3314,3174, 757,1869, 107,3530,6145,1194, 623,2262, 207,1253, # 2720
|
220 |
+
2167,3446,3948, 492,1117,1935, 536,1838,2757,1246,4332, 696,2095,2406,1393,1572, # 2736
|
221 |
+
3175,1782, 583, 190, 253,1390,2230, 830,3126,3389, 934,3245,1703,1749,2979,1870, # 2752
|
222 |
+
2545,1656,2204, 869,2346,4116,3176,1817, 496,1764,4644, 942,1504, 404,1903,1122, # 2768
|
223 |
+
1580,3606,2945,1022, 515, 372,1735, 955,2431,3036,6146,2797,1110,2302,2798, 617, # 2784
|
224 |
+
6147, 441, 762,1771,3447,3607,3608,1904, 840,3037, 86, 939,1385, 572,1370,2445, # 2800
|
225 |
+
1336, 114,3703, 898, 294, 203,3315, 703,1583,2274, 429, 961,4333,1854,1951,3390, # 2816
|
226 |
+
2373,3704,4334,1318,1381, 966,1911,2322,1006,1155, 309, 989, 458,2718,1795,1372, # 2832
|
227 |
+
1203, 252,1689,1363,3177, 517,1936, 168,1490, 562, 193,3823,1042,4117,1835, 551, # 2848
|
228 |
+
470,4645, 395, 489,3448,1871,1465,2583,2641, 417,1493, 279,1295, 511,1236,1119, # 2864
|
229 |
+
72,1231,1982,1812,3004, 871,1564, 984,3449,1667,2696,2096,4646,2347,2833,1673, # 2880
|
230 |
+
3609, 695,3246,2668, 807,1183,4647, 890, 388,2333,1801,1457,2911,1765,1477,1031, # 2896
|
231 |
+
3316,3317,1278,3391,2799,2292,2526, 163,3450,4335,2669,1404,1802,6148,2323,2407, # 2912
|
232 |
+
1584,1728,1494,1824,1269, 298, 909,3318,1034,1632, 375, 776,1683,2061, 291, 210, # 2928
|
233 |
+
1123, 809,1249,1002,2642,3038, 206,1011,2132, 144, 975, 882,1565, 342, 667, 754, # 2944
|
234 |
+
1442,2143,1299,2303,2062, 447, 626,2205,1221,2739,2912,1144,1214,2206,2584, 760, # 2960
|
235 |
+
1715, 614, 950,1281,2670,2621, 810, 577,1287,2546,4648, 242,2168, 250,2643, 691, # 2976
|
236 |
+
123,2644, 647, 313,1029, 689,1357,2946,1650, 216, 771,1339,1306, 808,2063, 549, # 2992
|
237 |
+
913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079, 406, # 3008
|
238 |
+
2671,2117,3949,4649, 487,1825,2220,6150,2915, 448,2348,1073,6151,2397,1707, 130, # 3024
|
239 |
+
900,1598, 329, 176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155, # 3040
|
240 |
+
3706,1912,1513,1614,6153,1988, 646, 392,2304,1589,3320,3039,1826,1239,1352,1340, # 3056
|
241 |
+
2916, 505,2567,1709,1437,2408,2547, 906,6154,2672, 384,1458,1594,1100,1329, 710, # 3072
|
242 |
+
423,3531,2064,2231,2622,1989,2673,1087,1882, 333, 841,3005,1296,2882,2379, 580, # 3088
|
243 |
+
1937,1827,1293,2585, 601, 574, 249,1772,4118,2079,1120, 645, 901,1176,1690, 795, # 3104
|
244 |
+
2207, 478,1434, 516,1190,1530, 761,2080, 930,1264, 355, 435,1552, 644,1791, 987, # 3120
|
245 |
+
220,1364,1163,1121,1538, 306,2169,1327,1222, 546,2645, 218, 241, 610,1704,3321, # 3136
|
246 |
+
1984,1839,1966,2528, 451,6155,2586,3707,2568, 907,3178, 254,2947, 186,1845,4650, # 3152
|
247 |
+
745, 432,1757, 428,1633, 888,2246,2221,2489,3611,2118,1258,1265, 956,3127,1784, # 3168
|
248 |
+
4337,2490, 319, 510, 119, 457,3612, 274,2035,2007,4651,1409,3128, 970,2758, 590, # 3184
|
249 |
+
2800, 661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111, 485,2491, # 3200
|
250 |
+
1429,1156,6156,2548,2183,1495, 831,1840,2529,2446, 501,1657, 307,1894,3247,1341, # 3216
|
251 |
+
666, 899,2156,1539,2549,1559, 886, 349,2208,3081,2305,1736,3824,2170,2759,1014, # 3232
|
252 |
+
1913,1386, 542,1397,2948, 490, 368, 716, 362, 159, 282,2569,1129,1658,1288,1750, # 3248
|
253 |
+
2674, 276, 649,2016, 751,1496, 658,1818,1284,1862,2209,2087,2512,3451, 622,2834, # 3264
|
254 |
+
376, 117,1060,2053,1208,1721,1101,1443, 247,1250,3179,1792,3952,2760,2398,3953, # 3280
|
255 |
+
6157,2144,3708, 446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082, 424,2222, # 3296
|
256 |
+
1251,2449,2119,2836, 504,1581,4338, 602, 817, 857,3825,2349,2306, 357,3826,1470, # 3312
|
257 |
+
1883,2883, 255, 958, 929,2917,3248, 302,4653,1050,1271,1751,2307,1952,1430,2697, # 3328
|
258 |
+
2719,2359, 354,3180, 777, 158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232, # 3344
|
259 |
+
3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428, 637, 931,2721,2145, # 3360
|
260 |
+
914,2550,2587, 81,2450, 612, 827,2646,1242,4655,1118,2884, 472,1855,3181,3533, # 3376
|
261 |
+
3534, 569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152, # 3392
|
262 |
+
1938, 134,1830, 471,3710,2276,1112,1535,3323,3453,3535, 982,1337,2950, 488, 826, # 3408
|
263 |
+
674,1058,1628,4120,2017, 522,2399, 211, 568,1367,3454, 350, 293,1872,1139,3249, # 3424
|
264 |
+
1399,1946,3006,1300,2360,3324, 588, 736,6160,2606, 744, 669,3536,3828,6161,1358, # 3440
|
265 |
+
199, 723, 848, 933, 851,1939,1505,1514,1338,1618,1831,4656,1634,3613, 443,2740, # 3456
|
266 |
+
3829, 717,1947, 491,1914,6162,2551,1542,4121,1025,6163,1099,1223, 198,3040,2722, # 3472
|
267 |
+
370, 410,1905,2589, 998,1248,3182,2380, 519,1449,4122,1710, 947, 928,1153,4341, # 3488
|
268 |
+
2277, 344,2624,1511, 615, 105, 161,1212,1076,1960,3130,2054,1926,1175,1906,2473, # 3504
|
269 |
+
414,1873,2801,6164,2309, 315,1319,3325, 318,2018,2146,2157, 963, 631, 223,4342, # 3520
|
270 |
+
4343,2675, 479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886, # 3536
|
271 |
+
2184,1674,1330,1711,1635,1506, 799, 219,3250,3083,3954,1677,3713,3326,2081,3614, # 3552
|
272 |
+
1652,2073,4657,1147,3041,1752, 643,1961, 147,1974,3955,6167,1716,2037, 918,3007, # 3568
|
273 |
+
1994, 120,1537, 118, 609,3184,4345, 740,3455,1219, 332,1615,3830,6168,1621,2980, # 3584
|
274 |
+
1582, 783, 212, 553,2350,3714,1349,2433,2082,4124, 889,6169,2310,1275,1410, 973, # 3600
|
275 |
+
166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658, 629, 822,3008, 763, 940, # 3616
|
276 |
+
1990,2862, 439,2409,1566,1240,1622, 926,1282,1907,2764, 654,2210,1607, 327,1130, # 3632
|
277 |
+
3956,1678,1623,6170,2434,2192, 686, 608,3831,3715, 903,3957,3042,6171,2741,1522, # 3648
|
278 |
+
1915,1105,1555,2552,1359, 323,3251,4346,3457, 738,1354,2553,2311,2334,1828,2003, # 3664
|
279 |
+
3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847, 520,1204,2607, # 3680
|
280 |
+
264,4659, 836,2677,2102, 600,4660,3833,2278,3084,6174,4347,3615,1342, 640, 532, # 3696
|
281 |
+
543,2608,1888,2400,2591,1009,4348,1497, 341,1737,3616,2723,1394, 529,3252,1321, # 3712
|
282 |
+
983,4661,1515,2120, 971,2592, 924, 287,1662,3186,4349,2700,4350,1519, 908,1948, # 3728
|
283 |
+
2452, 156, 796,1629,1486,2223,2055, 694,4126,1259,1036,3392,1213,2249,2742,1889, # 3744
|
284 |
+
1230,3958,1015, 910, 408, 559,3617,4662, 746, 725, 935,4663,3959,3009,1289, 563, # 3760
|
285 |
+
867,4664,3960,1567,2981,2038,2626, 988,2263,2381,4351, 143,2374, 704,1895,6175, # 3776
|
286 |
+
1188,3716,2088, 673,3085,2362,4352, 484,1608,1921,2765,2918, 215, 904,3618,3537, # 3792
|
287 |
+
894, 509, 976,3043,2701,3961,4353,2837,2982, 498,6176,6177,1102,3538,1332,3393, # 3808
|
288 |
+
1487,1636,1637, 233, 245,3962, 383, 650, 995,3044, 460,1520,1206,2352, 749,3327, # 3824
|
289 |
+
530, 700, 389,1438,1560,1773,3963,2264, 719,2951,2724,3834, 870,1832,1644,1000, # 3840
|
290 |
+
839,2474,3717, 197,1630,3394, 365,2886,3964,1285,2133, 734, 922, 818,1106, 732, # 3856
|
291 |
+
480,2083,1774,3458, 923,2279,1350, 221,3086, 85,2233,2234,3835,1585,3010,2147, # 3872
|
292 |
+
1387,1705,2382,1619,2475, 133, 239,2802,1991,1016,2084,2383, 411,2838,1113, 651, # 3888
|
293 |
+
1985,1160,3328, 990,1863,3087,1048,1276,2647, 265,2627,1599,3253,2056, 150, 638, # 3904
|
294 |
+
2019, 656, 853, 326,1479, 680,1439,4354,1001,1759, 413,3459,3395,2492,1431, 459, # 3920
|
295 |
+
4355,1125,3329,2265,1953,1450,2065,2863, 849, 351,2678,3131,3254,3255,1104,1577, # 3936
|
296 |
+
227,1351,1645,2453,2193,1421,2887, 812,2121, 634, 95,2435, 201,2312,4665,1646, # 3952
|
297 |
+
1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189, # 3968
|
298 |
+
328,2679,1077,1940,1136, 558,1283, 964,1195, 621,2074,1199,1743,3460,3619,1896, # 3984
|
299 |
+
1916,1890,3836,2952,1154,2112,1064, 862, 378,3011,2066,2113,2803,1568,2839,6178, # 4000
|
300 |
+
3088,2919,1941,1660,2004,1992,2194, 142, 707,1590,1708,1624,1922,1023,1836,1233, # 4016
|
301 |
+
1004,2313, 789, 741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721, 593, # 4032
|
302 |
+
2840, 367,2920,1878,6180,3461,1521, 628,1168, 692,2211,2649, 300, 720,2067,2571, # 4048
|
303 |
+
2953,3396, 959,2504,3966,3539,3462,1977, 701,6181, 954,1043, 800, 681, 183,3722, # 4064
|
304 |
+
1803,1730,3540,4128,2103, 815,2314, 174, 467, 230,2454,1093,2134, 755,3541,3397, # 4080
|
305 |
+
1141,1162,6182,1738,2039, 270,3256,2513,1005,1647,2185,3837, 858,1679,1897,1719, # 4096
|
306 |
+
2954,2324,1806, 402, 670, 167,4129,1498,2158,2104, 750,6183, 915, 189,1680,1551, # 4112
|
307 |
+
455,4356,1501,2455, 405,1095,2955, 338,1586,1266,1819, 570, 641,1324, 237,1556, # 4128
|
308 |
+
2650,1388,3723,6184,1368,2384,1343,1978,3089,2436, 879,3724, 792,1191, 758,3012, # 4144
|
309 |
+
1411,2135,1322,4357, 240,4667,1848,3725,1574,6185, 420,3045,1546,1391, 714,4358, # 4160
|
310 |
+
1967, 941,1864, 863, 664, 426, 560,1731,2680,1785,2864,1949,2363, 403,3330,1415, # 4176
|
311 |
+
1279,2136,1697,2335, 204, 721,2097,3838, 90,6186,2085,2505, 191,3967, 124,2148, # 4192
|
312 |
+
1376,1798,1178,1107,1898,1405, 860,4359,1243,1272,2375,2983,1558,2456,1638, 113, # 4208
|
313 |
+
3621, 578,1923,2609, 880, 386,4130, 784,2186,2266,1422,2956,2172,1722, 497, 263, # 4224
|
314 |
+
2514,1267,2412,2610, 177,2703,3542, 774,1927,1344, 616,1432,1595,1018, 172,4360, # 4240
|
315 |
+
2325, 911,4361, 438,1468,3622, 794,3968,2024,2173,1681,1829,2957, 945, 895,3090, # 4256
|
316 |
+
575,2212,2476, 475,2401,2681, 785,2744,1745,2293,2555,1975,3133,2865, 394,4668, # 4272
|
317 |
+
3839, 635,4131, 639, 202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457, # 4288
|
318 |
+
3727,3134,4362, 843,2611, 437, 916,4669, 234, 769,1884,3046,3047,3623, 833,6187, # 4304
|
319 |
+
1639,2250,2402,1355,1185,2010,2047, 999, 525,1732,1290,1488,2612, 948,1578,3728, # 4320
|
320 |
+
2413,2477,1216,2725,2159, 334,3840,1328,3624,2921,1525,4132, 564,1056, 891,4363, # 4336
|
321 |
+
1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, # 4352
|
322 |
+
2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, # 4368 #last 512
|
323 |
+
)
|
324 |
+
|
325 |
+
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/jpcntx.py
ADDED
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Communicator client code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
|
29 |
+
# This is hiragana 2-char sequence table, the number in each cell represents its frequency category
|
30 |
+
jp2CharContext = (
|
31 |
+
(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1),
|
32 |
+
(2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4),
|
33 |
+
(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2),
|
34 |
+
(0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4),
|
35 |
+
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2),
|
112 |
+
(0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3),
|
113 |
+
(0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1),
|
114 |
+
)
|
115 |
+
|
116 |
+
class JapaneseContextAnalysis(object):
|
117 |
+
NUM_OF_CATEGORY = 6
|
118 |
+
DONT_KNOW = -1
|
119 |
+
ENOUGH_REL_THRESHOLD = 100
|
120 |
+
MAX_REL_THRESHOLD = 1000
|
121 |
+
MINIMUM_DATA_THRESHOLD = 4
|
122 |
+
|
123 |
+
def __init__(self):
|
124 |
+
self._total_rel = None
|
125 |
+
self._rel_sample = None
|
126 |
+
self._need_to_skip_char_num = None
|
127 |
+
self._last_char_order = None
|
128 |
+
self._done = None
|
129 |
+
self.reset()
|
130 |
+
|
131 |
+
def reset(self):
|
132 |
+
self._total_rel = 0 # total sequence received
|
133 |
+
# category counters, each integer counts sequence in its category
|
134 |
+
self._rel_sample = [0] * self.NUM_OF_CATEGORY
|
135 |
+
# if last byte in current buffer is not the last byte of a character,
|
136 |
+
# we need to know how many bytes to skip in next buffer
|
137 |
+
self._need_to_skip_char_num = 0
|
138 |
+
self._last_char_order = -1 # The order of previous char
|
139 |
+
# If this flag is set to True, detection is done and conclusion has
|
140 |
+
# been made
|
141 |
+
self._done = False
|
142 |
+
|
143 |
+
def feed(self, byte_str, num_bytes):
|
144 |
+
if self._done:
|
145 |
+
return
|
146 |
+
|
147 |
+
# The buffer we got is byte oriented, and a character may span in more than one
|
148 |
+
# buffers. In case the last one or two byte in last buffer is not
|
149 |
+
# complete, we record how many byte needed to complete that character
|
150 |
+
# and skip these bytes here. We can choose to record those bytes as
|
151 |
+
# well and analyse the character once it is complete, but since a
|
152 |
+
# character will not make much difference, by simply skipping
|
153 |
+
# this character will simply our logic and improve performance.
|
154 |
+
i = self._need_to_skip_char_num
|
155 |
+
while i < num_bytes:
|
156 |
+
order, char_len = self.get_order(byte_str[i:i + 2])
|
157 |
+
i += char_len
|
158 |
+
if i > num_bytes:
|
159 |
+
self._need_to_skip_char_num = i - num_bytes
|
160 |
+
self._last_char_order = -1
|
161 |
+
else:
|
162 |
+
if (order != -1) and (self._last_char_order != -1):
|
163 |
+
self._total_rel += 1
|
164 |
+
if self._total_rel > self.MAX_REL_THRESHOLD:
|
165 |
+
self._done = True
|
166 |
+
break
|
167 |
+
self._rel_sample[jp2CharContext[self._last_char_order][order]] += 1
|
168 |
+
self._last_char_order = order
|
169 |
+
|
170 |
+
def got_enough_data(self):
|
171 |
+
return self._total_rel > self.ENOUGH_REL_THRESHOLD
|
172 |
+
|
173 |
+
def get_confidence(self):
|
174 |
+
# This is just one way to calculate confidence. It works well for me.
|
175 |
+
if self._total_rel > self.MINIMUM_DATA_THRESHOLD:
|
176 |
+
return (self._total_rel - self._rel_sample[0]) / self._total_rel
|
177 |
+
else:
|
178 |
+
return self.DONT_KNOW
|
179 |
+
|
180 |
+
def get_order(self, byte_str):
|
181 |
+
return -1, 1
|
182 |
+
|
183 |
+
class SJISContextAnalysis(JapaneseContextAnalysis):
|
184 |
+
def __init__(self):
|
185 |
+
super(SJISContextAnalysis, self).__init__()
|
186 |
+
self._charset_name = "SHIFT_JIS"
|
187 |
+
|
188 |
+
@property
|
189 |
+
def charset_name(self):
|
190 |
+
return self._charset_name
|
191 |
+
|
192 |
+
def get_order(self, byte_str):
|
193 |
+
if not byte_str:
|
194 |
+
return -1, 1
|
195 |
+
# find out current char's byte length
|
196 |
+
first_char = byte_str[0]
|
197 |
+
if (0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC):
|
198 |
+
char_len = 2
|
199 |
+
if (first_char == 0x87) or (0xFA <= first_char <= 0xFC):
|
200 |
+
self._charset_name = "CP932"
|
201 |
+
else:
|
202 |
+
char_len = 1
|
203 |
+
|
204 |
+
# return its order if it is hiragana
|
205 |
+
if len(byte_str) > 1:
|
206 |
+
second_char = byte_str[1]
|
207 |
+
if (first_char == 202) and (0x9F <= second_char <= 0xF1):
|
208 |
+
return second_char - 0x9F, char_len
|
209 |
+
|
210 |
+
return -1, char_len
|
211 |
+
|
212 |
+
class EUCJPContextAnalysis(JapaneseContextAnalysis):
|
213 |
+
def get_order(self, byte_str):
|
214 |
+
if not byte_str:
|
215 |
+
return -1, 1
|
216 |
+
# find out current char's byte length
|
217 |
+
first_char = byte_str[0]
|
218 |
+
if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):
|
219 |
+
char_len = 2
|
220 |
+
elif first_char == 0x8F:
|
221 |
+
char_len = 3
|
222 |
+
else:
|
223 |
+
char_len = 1
|
224 |
+
|
225 |
+
# return its order if it is hiragana
|
226 |
+
if len(byte_str) > 1:
|
227 |
+
second_char = byte_str[1]
|
228 |
+
if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):
|
229 |
+
return second_char - 0xA1, char_len
|
230 |
+
|
231 |
+
return -1, char_len
|
232 |
+
|
233 |
+
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langbulgarianmodel.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langhungarianmodel.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langthaimodel.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/langturkishmodel.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcharsetprober.py
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Universal charset detector code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 2001
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
# Shy Shalom - original C code
|
12 |
+
# Proofpoint, Inc.
|
13 |
+
#
|
14 |
+
# This library is free software; you can redistribute it and/or
|
15 |
+
# modify it under the terms of the GNU Lesser General Public
|
16 |
+
# License as published by the Free Software Foundation; either
|
17 |
+
# version 2.1 of the License, or (at your option) any later version.
|
18 |
+
#
|
19 |
+
# This library is distributed in the hope that it will be useful,
|
20 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
22 |
+
# Lesser General Public License for more details.
|
23 |
+
#
|
24 |
+
# You should have received a copy of the GNU Lesser General Public
|
25 |
+
# License along with this library; if not, write to the Free Software
|
26 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
27 |
+
# 02110-1301 USA
|
28 |
+
######################### END LICENSE BLOCK #########################
|
29 |
+
|
30 |
+
from .charsetprober import CharSetProber
|
31 |
+
from .enums import ProbingState, MachineState
|
32 |
+
|
33 |
+
|
34 |
+
class MultiByteCharSetProber(CharSetProber):
|
35 |
+
"""
|
36 |
+
MultiByteCharSetProber
|
37 |
+
"""
|
38 |
+
|
39 |
+
def __init__(self, lang_filter=None):
|
40 |
+
super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter)
|
41 |
+
self.distribution_analyzer = None
|
42 |
+
self.coding_sm = None
|
43 |
+
self._last_char = [0, 0]
|
44 |
+
|
45 |
+
def reset(self):
|
46 |
+
super(MultiByteCharSetProber, self).reset()
|
47 |
+
if self.coding_sm:
|
48 |
+
self.coding_sm.reset()
|
49 |
+
if self.distribution_analyzer:
|
50 |
+
self.distribution_analyzer.reset()
|
51 |
+
self._last_char = [0, 0]
|
52 |
+
|
53 |
+
@property
|
54 |
+
def charset_name(self):
|
55 |
+
raise NotImplementedError
|
56 |
+
|
57 |
+
@property
|
58 |
+
def language(self):
|
59 |
+
raise NotImplementedError
|
60 |
+
|
61 |
+
def feed(self, byte_str):
|
62 |
+
for i in range(len(byte_str)):
|
63 |
+
coding_state = self.coding_sm.next_state(byte_str[i])
|
64 |
+
if coding_state == MachineState.ERROR:
|
65 |
+
self.logger.debug('%s %s prober hit error at byte %s',
|
66 |
+
self.charset_name, self.language, i)
|
67 |
+
self._state = ProbingState.NOT_ME
|
68 |
+
break
|
69 |
+
elif coding_state == MachineState.ITS_ME:
|
70 |
+
self._state = ProbingState.FOUND_IT
|
71 |
+
break
|
72 |
+
elif coding_state == MachineState.START:
|
73 |
+
char_len = self.coding_sm.get_current_charlen()
|
74 |
+
if i == 0:
|
75 |
+
self._last_char[1] = byte_str[0]
|
76 |
+
self.distribution_analyzer.feed(self._last_char, char_len)
|
77 |
+
else:
|
78 |
+
self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
|
79 |
+
char_len)
|
80 |
+
|
81 |
+
self._last_char[0] = byte_str[-1]
|
82 |
+
|
83 |
+
if self.state == ProbingState.DETECTING:
|
84 |
+
if (self.distribution_analyzer.got_enough_data() and
|
85 |
+
(self.get_confidence() > self.SHORTCUT_THRESHOLD)):
|
86 |
+
self._state = ProbingState.FOUND_IT
|
87 |
+
|
88 |
+
return self.state
|
89 |
+
|
90 |
+
def get_confidence(self):
|
91 |
+
return self.distribution_analyzer.get_confidence()
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcsgroupprober.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Universal charset detector code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 2001
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
# Shy Shalom - original C code
|
12 |
+
# Proofpoint, Inc.
|
13 |
+
#
|
14 |
+
# This library is free software; you can redistribute it and/or
|
15 |
+
# modify it under the terms of the GNU Lesser General Public
|
16 |
+
# License as published by the Free Software Foundation; either
|
17 |
+
# version 2.1 of the License, or (at your option) any later version.
|
18 |
+
#
|
19 |
+
# This library is distributed in the hope that it will be useful,
|
20 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
22 |
+
# Lesser General Public License for more details.
|
23 |
+
#
|
24 |
+
# You should have received a copy of the GNU Lesser General Public
|
25 |
+
# License along with this library; if not, write to the Free Software
|
26 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
27 |
+
# 02110-1301 USA
|
28 |
+
######################### END LICENSE BLOCK #########################
|
29 |
+
|
30 |
+
from .charsetgroupprober import CharSetGroupProber
|
31 |
+
from .utf8prober import UTF8Prober
|
32 |
+
from .sjisprober import SJISProber
|
33 |
+
from .eucjpprober import EUCJPProber
|
34 |
+
from .gb2312prober import GB2312Prober
|
35 |
+
from .euckrprober import EUCKRProber
|
36 |
+
from .cp949prober import CP949Prober
|
37 |
+
from .big5prober import Big5Prober
|
38 |
+
from .euctwprober import EUCTWProber
|
39 |
+
|
40 |
+
|
41 |
+
class MBCSGroupProber(CharSetGroupProber):
|
42 |
+
def __init__(self, lang_filter=None):
|
43 |
+
super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)
|
44 |
+
self.probers = [
|
45 |
+
UTF8Prober(),
|
46 |
+
SJISProber(),
|
47 |
+
EUCJPProber(),
|
48 |
+
GB2312Prober(),
|
49 |
+
EUCKRProber(),
|
50 |
+
CP949Prober(),
|
51 |
+
Big5Prober(),
|
52 |
+
EUCTWProber()
|
53 |
+
]
|
54 |
+
self.reset()
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/mbcssm.py
ADDED
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is mozilla.org code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .enums import MachineState
|
29 |
+
|
30 |
+
# BIG5
|
31 |
+
|
32 |
+
BIG5_CLS = (
|
33 |
+
1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value
|
34 |
+
1,1,1,1,1,1,0,0, # 08 - 0f
|
35 |
+
1,1,1,1,1,1,1,1, # 10 - 17
|
36 |
+
1,1,1,0,1,1,1,1, # 18 - 1f
|
37 |
+
1,1,1,1,1,1,1,1, # 20 - 27
|
38 |
+
1,1,1,1,1,1,1,1, # 28 - 2f
|
39 |
+
1,1,1,1,1,1,1,1, # 30 - 37
|
40 |
+
1,1,1,1,1,1,1,1, # 38 - 3f
|
41 |
+
2,2,2,2,2,2,2,2, # 40 - 47
|
42 |
+
2,2,2,2,2,2,2,2, # 48 - 4f
|
43 |
+
2,2,2,2,2,2,2,2, # 50 - 57
|
44 |
+
2,2,2,2,2,2,2,2, # 58 - 5f
|
45 |
+
2,2,2,2,2,2,2,2, # 60 - 67
|
46 |
+
2,2,2,2,2,2,2,2, # 68 - 6f
|
47 |
+
2,2,2,2,2,2,2,2, # 70 - 77
|
48 |
+
2,2,2,2,2,2,2,1, # 78 - 7f
|
49 |
+
4,4,4,4,4,4,4,4, # 80 - 87
|
50 |
+
4,4,4,4,4,4,4,4, # 88 - 8f
|
51 |
+
4,4,4,4,4,4,4,4, # 90 - 97
|
52 |
+
4,4,4,4,4,4,4,4, # 98 - 9f
|
53 |
+
4,3,3,3,3,3,3,3, # a0 - a7
|
54 |
+
3,3,3,3,3,3,3,3, # a8 - af
|
55 |
+
3,3,3,3,3,3,3,3, # b0 - b7
|
56 |
+
3,3,3,3,3,3,3,3, # b8 - bf
|
57 |
+
3,3,3,3,3,3,3,3, # c0 - c7
|
58 |
+
3,3,3,3,3,3,3,3, # c8 - cf
|
59 |
+
3,3,3,3,3,3,3,3, # d0 - d7
|
60 |
+
3,3,3,3,3,3,3,3, # d8 - df
|
61 |
+
3,3,3,3,3,3,3,3, # e0 - e7
|
62 |
+
3,3,3,3,3,3,3,3, # e8 - ef
|
63 |
+
3,3,3,3,3,3,3,3, # f0 - f7
|
64 |
+
3,3,3,3,3,3,3,0 # f8 - ff
|
65 |
+
)
|
66 |
+
|
67 |
+
BIG5_ST = (
|
68 |
+
MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
69 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f
|
70 |
+
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17
|
71 |
+
)
|
72 |
+
|
73 |
+
BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0)
|
74 |
+
|
75 |
+
BIG5_SM_MODEL = {'class_table': BIG5_CLS,
|
76 |
+
'class_factor': 5,
|
77 |
+
'state_table': BIG5_ST,
|
78 |
+
'char_len_table': BIG5_CHAR_LEN_TABLE,
|
79 |
+
'name': 'Big5'}
|
80 |
+
|
81 |
+
# CP949
|
82 |
+
|
83 |
+
CP949_CLS = (
|
84 |
+
1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f
|
85 |
+
1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f
|
86 |
+
1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f
|
87 |
+
1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f
|
88 |
+
1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f
|
89 |
+
4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f
|
90 |
+
1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f
|
91 |
+
5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f
|
92 |
+
0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f
|
93 |
+
6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f
|
94 |
+
6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af
|
95 |
+
7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf
|
96 |
+
7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf
|
97 |
+
2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df
|
98 |
+
2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef
|
99 |
+
2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff
|
100 |
+
)
|
101 |
+
|
102 |
+
CP949_ST = (
|
103 |
+
#cls= 0 1 2 3 4 5 6 7 8 9 # previous state =
|
104 |
+
MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START, 4, 5,MachineState.ERROR, 6, # MachineState.START
|
105 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR
|
106 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME
|
107 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3
|
108 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4
|
109 |
+
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5
|
110 |
+
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6
|
111 |
+
)
|
112 |
+
|
113 |
+
CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)
|
114 |
+
|
115 |
+
CP949_SM_MODEL = {'class_table': CP949_CLS,
|
116 |
+
'class_factor': 10,
|
117 |
+
'state_table': CP949_ST,
|
118 |
+
'char_len_table': CP949_CHAR_LEN_TABLE,
|
119 |
+
'name': 'CP949'}
|
120 |
+
|
121 |
+
# EUC-JP
|
122 |
+
|
123 |
+
EUCJP_CLS = (
|
124 |
+
4,4,4,4,4,4,4,4, # 00 - 07
|
125 |
+
4,4,4,4,4,4,5,5, # 08 - 0f
|
126 |
+
4,4,4,4,4,4,4,4, # 10 - 17
|
127 |
+
4,4,4,5,4,4,4,4, # 18 - 1f
|
128 |
+
4,4,4,4,4,4,4,4, # 20 - 27
|
129 |
+
4,4,4,4,4,4,4,4, # 28 - 2f
|
130 |
+
4,4,4,4,4,4,4,4, # 30 - 37
|
131 |
+
4,4,4,4,4,4,4,4, # 38 - 3f
|
132 |
+
4,4,4,4,4,4,4,4, # 40 - 47
|
133 |
+
4,4,4,4,4,4,4,4, # 48 - 4f
|
134 |
+
4,4,4,4,4,4,4,4, # 50 - 57
|
135 |
+
4,4,4,4,4,4,4,4, # 58 - 5f
|
136 |
+
4,4,4,4,4,4,4,4, # 60 - 67
|
137 |
+
4,4,4,4,4,4,4,4, # 68 - 6f
|
138 |
+
4,4,4,4,4,4,4,4, # 70 - 77
|
139 |
+
4,4,4,4,4,4,4,4, # 78 - 7f
|
140 |
+
5,5,5,5,5,5,5,5, # 80 - 87
|
141 |
+
5,5,5,5,5,5,1,3, # 88 - 8f
|
142 |
+
5,5,5,5,5,5,5,5, # 90 - 97
|
143 |
+
5,5,5,5,5,5,5,5, # 98 - 9f
|
144 |
+
5,2,2,2,2,2,2,2, # a0 - a7
|
145 |
+
2,2,2,2,2,2,2,2, # a8 - af
|
146 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
147 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
148 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
149 |
+
2,2,2,2,2,2,2,2, # c8 - cf
|
150 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
151 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
152 |
+
0,0,0,0,0,0,0,0, # e0 - e7
|
153 |
+
0,0,0,0,0,0,0,0, # e8 - ef
|
154 |
+
0,0,0,0,0,0,0,0, # f0 - f7
|
155 |
+
0,0,0,0,0,0,0,5 # f8 - ff
|
156 |
+
)
|
157 |
+
|
158 |
+
EUCJP_ST = (
|
159 |
+
3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
160 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
161 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
|
162 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f
|
163 |
+
3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27
|
164 |
+
)
|
165 |
+
|
166 |
+
EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0)
|
167 |
+
|
168 |
+
EUCJP_SM_MODEL = {'class_table': EUCJP_CLS,
|
169 |
+
'class_factor': 6,
|
170 |
+
'state_table': EUCJP_ST,
|
171 |
+
'char_len_table': EUCJP_CHAR_LEN_TABLE,
|
172 |
+
'name': 'EUC-JP'}
|
173 |
+
|
174 |
+
# EUC-KR
|
175 |
+
|
176 |
+
EUCKR_CLS = (
|
177 |
+
1,1,1,1,1,1,1,1, # 00 - 07
|
178 |
+
1,1,1,1,1,1,0,0, # 08 - 0f
|
179 |
+
1,1,1,1,1,1,1,1, # 10 - 17
|
180 |
+
1,1,1,0,1,1,1,1, # 18 - 1f
|
181 |
+
1,1,1,1,1,1,1,1, # 20 - 27
|
182 |
+
1,1,1,1,1,1,1,1, # 28 - 2f
|
183 |
+
1,1,1,1,1,1,1,1, # 30 - 37
|
184 |
+
1,1,1,1,1,1,1,1, # 38 - 3f
|
185 |
+
1,1,1,1,1,1,1,1, # 40 - 47
|
186 |
+
1,1,1,1,1,1,1,1, # 48 - 4f
|
187 |
+
1,1,1,1,1,1,1,1, # 50 - 57
|
188 |
+
1,1,1,1,1,1,1,1, # 58 - 5f
|
189 |
+
1,1,1,1,1,1,1,1, # 60 - 67
|
190 |
+
1,1,1,1,1,1,1,1, # 68 - 6f
|
191 |
+
1,1,1,1,1,1,1,1, # 70 - 77
|
192 |
+
1,1,1,1,1,1,1,1, # 78 - 7f
|
193 |
+
0,0,0,0,0,0,0,0, # 80 - 87
|
194 |
+
0,0,0,0,0,0,0,0, # 88 - 8f
|
195 |
+
0,0,0,0,0,0,0,0, # 90 - 97
|
196 |
+
0,0,0,0,0,0,0,0, # 98 - 9f
|
197 |
+
0,2,2,2,2,2,2,2, # a0 - a7
|
198 |
+
2,2,2,2,2,3,3,3, # a8 - af
|
199 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
200 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
201 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
202 |
+
2,3,2,2,2,2,2,2, # c8 - cf
|
203 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
204 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
205 |
+
2,2,2,2,2,2,2,2, # e0 - e7
|
206 |
+
2,2,2,2,2,2,2,2, # e8 - ef
|
207 |
+
2,2,2,2,2,2,2,2, # f0 - f7
|
208 |
+
2,2,2,2,2,2,2,0 # f8 - ff
|
209 |
+
)
|
210 |
+
|
211 |
+
EUCKR_ST = (
|
212 |
+
MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
213 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f
|
214 |
+
)
|
215 |
+
|
216 |
+
EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0)
|
217 |
+
|
218 |
+
EUCKR_SM_MODEL = {'class_table': EUCKR_CLS,
|
219 |
+
'class_factor': 4,
|
220 |
+
'state_table': EUCKR_ST,
|
221 |
+
'char_len_table': EUCKR_CHAR_LEN_TABLE,
|
222 |
+
'name': 'EUC-KR'}
|
223 |
+
|
224 |
+
# EUC-TW
|
225 |
+
|
226 |
+
EUCTW_CLS = (
|
227 |
+
2,2,2,2,2,2,2,2, # 00 - 07
|
228 |
+
2,2,2,2,2,2,0,0, # 08 - 0f
|
229 |
+
2,2,2,2,2,2,2,2, # 10 - 17
|
230 |
+
2,2,2,0,2,2,2,2, # 18 - 1f
|
231 |
+
2,2,2,2,2,2,2,2, # 20 - 27
|
232 |
+
2,2,2,2,2,2,2,2, # 28 - 2f
|
233 |
+
2,2,2,2,2,2,2,2, # 30 - 37
|
234 |
+
2,2,2,2,2,2,2,2, # 38 - 3f
|
235 |
+
2,2,2,2,2,2,2,2, # 40 - 47
|
236 |
+
2,2,2,2,2,2,2,2, # 48 - 4f
|
237 |
+
2,2,2,2,2,2,2,2, # 50 - 57
|
238 |
+
2,2,2,2,2,2,2,2, # 58 - 5f
|
239 |
+
2,2,2,2,2,2,2,2, # 60 - 67
|
240 |
+
2,2,2,2,2,2,2,2, # 68 - 6f
|
241 |
+
2,2,2,2,2,2,2,2, # 70 - 77
|
242 |
+
2,2,2,2,2,2,2,2, # 78 - 7f
|
243 |
+
0,0,0,0,0,0,0,0, # 80 - 87
|
244 |
+
0,0,0,0,0,0,6,0, # 88 - 8f
|
245 |
+
0,0,0,0,0,0,0,0, # 90 - 97
|
246 |
+
0,0,0,0,0,0,0,0, # 98 - 9f
|
247 |
+
0,3,4,4,4,4,4,4, # a0 - a7
|
248 |
+
5,5,1,1,1,1,1,1, # a8 - af
|
249 |
+
1,1,1,1,1,1,1,1, # b0 - b7
|
250 |
+
1,1,1,1,1,1,1,1, # b8 - bf
|
251 |
+
1,1,3,1,3,3,3,3, # c0 - c7
|
252 |
+
3,3,3,3,3,3,3,3, # c8 - cf
|
253 |
+
3,3,3,3,3,3,3,3, # d0 - d7
|
254 |
+
3,3,3,3,3,3,3,3, # d8 - df
|
255 |
+
3,3,3,3,3,3,3,3, # e0 - e7
|
256 |
+
3,3,3,3,3,3,3,3, # e8 - ef
|
257 |
+
3,3,3,3,3,3,3,3, # f0 - f7
|
258 |
+
3,3,3,3,3,3,3,0 # f8 - ff
|
259 |
+
)
|
260 |
+
|
261 |
+
EUCTW_ST = (
|
262 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07
|
263 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
264 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17
|
265 |
+
MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
266 |
+
5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27
|
267 |
+
MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
|
268 |
+
)
|
269 |
+
|
270 |
+
EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3)
|
271 |
+
|
272 |
+
EUCTW_SM_MODEL = {'class_table': EUCTW_CLS,
|
273 |
+
'class_factor': 7,
|
274 |
+
'state_table': EUCTW_ST,
|
275 |
+
'char_len_table': EUCTW_CHAR_LEN_TABLE,
|
276 |
+
'name': 'x-euc-tw'}
|
277 |
+
|
278 |
+
# GB2312
|
279 |
+
|
280 |
+
GB2312_CLS = (
|
281 |
+
1,1,1,1,1,1,1,1, # 00 - 07
|
282 |
+
1,1,1,1,1,1,0,0, # 08 - 0f
|
283 |
+
1,1,1,1,1,1,1,1, # 10 - 17
|
284 |
+
1,1,1,0,1,1,1,1, # 18 - 1f
|
285 |
+
1,1,1,1,1,1,1,1, # 20 - 27
|
286 |
+
1,1,1,1,1,1,1,1, # 28 - 2f
|
287 |
+
3,3,3,3,3,3,3,3, # 30 - 37
|
288 |
+
3,3,1,1,1,1,1,1, # 38 - 3f
|
289 |
+
2,2,2,2,2,2,2,2, # 40 - 47
|
290 |
+
2,2,2,2,2,2,2,2, # 48 - 4f
|
291 |
+
2,2,2,2,2,2,2,2, # 50 - 57
|
292 |
+
2,2,2,2,2,2,2,2, # 58 - 5f
|
293 |
+
2,2,2,2,2,2,2,2, # 60 - 67
|
294 |
+
2,2,2,2,2,2,2,2, # 68 - 6f
|
295 |
+
2,2,2,2,2,2,2,2, # 70 - 77
|
296 |
+
2,2,2,2,2,2,2,4, # 78 - 7f
|
297 |
+
5,6,6,6,6,6,6,6, # 80 - 87
|
298 |
+
6,6,6,6,6,6,6,6, # 88 - 8f
|
299 |
+
6,6,6,6,6,6,6,6, # 90 - 97
|
300 |
+
6,6,6,6,6,6,6,6, # 98 - 9f
|
301 |
+
6,6,6,6,6,6,6,6, # a0 - a7
|
302 |
+
6,6,6,6,6,6,6,6, # a8 - af
|
303 |
+
6,6,6,6,6,6,6,6, # b0 - b7
|
304 |
+
6,6,6,6,6,6,6,6, # b8 - bf
|
305 |
+
6,6,6,6,6,6,6,6, # c0 - c7
|
306 |
+
6,6,6,6,6,6,6,6, # c8 - cf
|
307 |
+
6,6,6,6,6,6,6,6, # d0 - d7
|
308 |
+
6,6,6,6,6,6,6,6, # d8 - df
|
309 |
+
6,6,6,6,6,6,6,6, # e0 - e7
|
310 |
+
6,6,6,6,6,6,6,6, # e8 - ef
|
311 |
+
6,6,6,6,6,6,6,6, # f0 - f7
|
312 |
+
6,6,6,6,6,6,6,0 # f8 - ff
|
313 |
+
)
|
314 |
+
|
315 |
+
GB2312_ST = (
|
316 |
+
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07
|
317 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
318 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17
|
319 |
+
4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
320 |
+
MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27
|
321 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
|
322 |
+
)
|
323 |
+
|
324 |
+
# To be accurate, the length of class 6 can be either 2 or 4.
|
325 |
+
# But it is not necessary to discriminate between the two since
|
326 |
+
# it is used for frequency analysis only, and we are validating
|
327 |
+
# each code range there as well. So it is safe to set it to be
|
328 |
+
# 2 here.
|
329 |
+
GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2)
|
330 |
+
|
331 |
+
GB2312_SM_MODEL = {'class_table': GB2312_CLS,
|
332 |
+
'class_factor': 7,
|
333 |
+
'state_table': GB2312_ST,
|
334 |
+
'char_len_table': GB2312_CHAR_LEN_TABLE,
|
335 |
+
'name': 'GB2312'}
|
336 |
+
|
337 |
+
# Shift_JIS
|
338 |
+
|
339 |
+
SJIS_CLS = (
|
340 |
+
1,1,1,1,1,1,1,1, # 00 - 07
|
341 |
+
1,1,1,1,1,1,0,0, # 08 - 0f
|
342 |
+
1,1,1,1,1,1,1,1, # 10 - 17
|
343 |
+
1,1,1,0,1,1,1,1, # 18 - 1f
|
344 |
+
1,1,1,1,1,1,1,1, # 20 - 27
|
345 |
+
1,1,1,1,1,1,1,1, # 28 - 2f
|
346 |
+
1,1,1,1,1,1,1,1, # 30 - 37
|
347 |
+
1,1,1,1,1,1,1,1, # 38 - 3f
|
348 |
+
2,2,2,2,2,2,2,2, # 40 - 47
|
349 |
+
2,2,2,2,2,2,2,2, # 48 - 4f
|
350 |
+
2,2,2,2,2,2,2,2, # 50 - 57
|
351 |
+
2,2,2,2,2,2,2,2, # 58 - 5f
|
352 |
+
2,2,2,2,2,2,2,2, # 60 - 67
|
353 |
+
2,2,2,2,2,2,2,2, # 68 - 6f
|
354 |
+
2,2,2,2,2,2,2,2, # 70 - 77
|
355 |
+
2,2,2,2,2,2,2,1, # 78 - 7f
|
356 |
+
3,3,3,3,3,2,2,3, # 80 - 87
|
357 |
+
3,3,3,3,3,3,3,3, # 88 - 8f
|
358 |
+
3,3,3,3,3,3,3,3, # 90 - 97
|
359 |
+
3,3,3,3,3,3,3,3, # 98 - 9f
|
360 |
+
#0xa0 is illegal in sjis encoding, but some pages does
|
361 |
+
#contain such byte. We need to be more error forgiven.
|
362 |
+
2,2,2,2,2,2,2,2, # a0 - a7
|
363 |
+
2,2,2,2,2,2,2,2, # a8 - af
|
364 |
+
2,2,2,2,2,2,2,2, # b0 - b7
|
365 |
+
2,2,2,2,2,2,2,2, # b8 - bf
|
366 |
+
2,2,2,2,2,2,2,2, # c0 - c7
|
367 |
+
2,2,2,2,2,2,2,2, # c8 - cf
|
368 |
+
2,2,2,2,2,2,2,2, # d0 - d7
|
369 |
+
2,2,2,2,2,2,2,2, # d8 - df
|
370 |
+
3,3,3,3,3,3,3,3, # e0 - e7
|
371 |
+
3,3,3,3,3,4,4,4, # e8 - ef
|
372 |
+
3,3,3,3,3,3,3,3, # f0 - f7
|
373 |
+
3,3,3,3,3,0,0,0) # f8 - ff
|
374 |
+
|
375 |
+
|
376 |
+
SJIS_ST = (
|
377 |
+
MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
378 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
379 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17
|
380 |
+
)
|
381 |
+
|
382 |
+
SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0)
|
383 |
+
|
384 |
+
SJIS_SM_MODEL = {'class_table': SJIS_CLS,
|
385 |
+
'class_factor': 6,
|
386 |
+
'state_table': SJIS_ST,
|
387 |
+
'char_len_table': SJIS_CHAR_LEN_TABLE,
|
388 |
+
'name': 'Shift_JIS'}
|
389 |
+
|
390 |
+
# UCS2-BE
|
391 |
+
|
392 |
+
UCS2BE_CLS = (
|
393 |
+
0,0,0,0,0,0,0,0, # 00 - 07
|
394 |
+
0,0,1,0,0,2,0,0, # 08 - 0f
|
395 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
396 |
+
0,0,0,3,0,0,0,0, # 18 - 1f
|
397 |
+
0,0,0,0,0,0,0,0, # 20 - 27
|
398 |
+
0,3,3,3,3,3,0,0, # 28 - 2f
|
399 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
400 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
401 |
+
0,0,0,0,0,0,0,0, # 40 - 47
|
402 |
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
403 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
404 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
405 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
406 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
407 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
408 |
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
409 |
+
0,0,0,0,0,0,0,0, # 80 - 87
|
410 |
+
0,0,0,0,0,0,0,0, # 88 - 8f
|
411 |
+
0,0,0,0,0,0,0,0, # 90 - 97
|
412 |
+
0,0,0,0,0,0,0,0, # 98 - 9f
|
413 |
+
0,0,0,0,0,0,0,0, # a0 - a7
|
414 |
+
0,0,0,0,0,0,0,0, # a8 - af
|
415 |
+
0,0,0,0,0,0,0,0, # b0 - b7
|
416 |
+
0,0,0,0,0,0,0,0, # b8 - bf
|
417 |
+
0,0,0,0,0,0,0,0, # c0 - c7
|
418 |
+
0,0,0,0,0,0,0,0, # c8 - cf
|
419 |
+
0,0,0,0,0,0,0,0, # d0 - d7
|
420 |
+
0,0,0,0,0,0,0,0, # d8 - df
|
421 |
+
0,0,0,0,0,0,0,0, # e0 - e7
|
422 |
+
0,0,0,0,0,0,0,0, # e8 - ef
|
423 |
+
0,0,0,0,0,0,0,0, # f0 - f7
|
424 |
+
0,0,0,0,0,0,4,5 # f8 - ff
|
425 |
+
)
|
426 |
+
|
427 |
+
UCS2BE_ST = (
|
428 |
+
5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
|
429 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
430 |
+
MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17
|
431 |
+
6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f
|
432 |
+
6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27
|
433 |
+
5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f
|
434 |
+
6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37
|
435 |
+
)
|
436 |
+
|
437 |
+
UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2)
|
438 |
+
|
439 |
+
UCS2BE_SM_MODEL = {'class_table': UCS2BE_CLS,
|
440 |
+
'class_factor': 6,
|
441 |
+
'state_table': UCS2BE_ST,
|
442 |
+
'char_len_table': UCS2BE_CHAR_LEN_TABLE,
|
443 |
+
'name': 'UTF-16BE'}
|
444 |
+
|
445 |
+
# UCS2-LE
|
446 |
+
|
447 |
+
UCS2LE_CLS = (
|
448 |
+
0,0,0,0,0,0,0,0, # 00 - 07
|
449 |
+
0,0,1,0,0,2,0,0, # 08 - 0f
|
450 |
+
0,0,0,0,0,0,0,0, # 10 - 17
|
451 |
+
0,0,0,3,0,0,0,0, # 18 - 1f
|
452 |
+
0,0,0,0,0,0,0,0, # 20 - 27
|
453 |
+
0,3,3,3,3,3,0,0, # 28 - 2f
|
454 |
+
0,0,0,0,0,0,0,0, # 30 - 37
|
455 |
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
456 |
+
0,0,0,0,0,0,0,0, # 40 - 47
|
457 |
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
458 |
+
0,0,0,0,0,0,0,0, # 50 - 57
|
459 |
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
460 |
+
0,0,0,0,0,0,0,0, # 60 - 67
|
461 |
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
462 |
+
0,0,0,0,0,0,0,0, # 70 - 77
|
463 |
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
464 |
+
0,0,0,0,0,0,0,0, # 80 - 87
|
465 |
+
0,0,0,0,0,0,0,0, # 88 - 8f
|
466 |
+
0,0,0,0,0,0,0,0, # 90 - 97
|
467 |
+
0,0,0,0,0,0,0,0, # 98 - 9f
|
468 |
+
0,0,0,0,0,0,0,0, # a0 - a7
|
469 |
+
0,0,0,0,0,0,0,0, # a8 - af
|
470 |
+
0,0,0,0,0,0,0,0, # b0 - b7
|
471 |
+
0,0,0,0,0,0,0,0, # b8 - bf
|
472 |
+
0,0,0,0,0,0,0,0, # c0 - c7
|
473 |
+
0,0,0,0,0,0,0,0, # c8 - cf
|
474 |
+
0,0,0,0,0,0,0,0, # d0 - d7
|
475 |
+
0,0,0,0,0,0,0,0, # d8 - df
|
476 |
+
0,0,0,0,0,0,0,0, # e0 - e7
|
477 |
+
0,0,0,0,0,0,0,0, # e8 - ef
|
478 |
+
0,0,0,0,0,0,0,0, # f0 - f7
|
479 |
+
0,0,0,0,0,0,4,5 # f8 - ff
|
480 |
+
)
|
481 |
+
|
482 |
+
UCS2LE_ST = (
|
483 |
+
6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
|
484 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
485 |
+
MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17
|
486 |
+
5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f
|
487 |
+
7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27
|
488 |
+
5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f
|
489 |
+
5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37
|
490 |
+
)
|
491 |
+
|
492 |
+
UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2)
|
493 |
+
|
494 |
+
UCS2LE_SM_MODEL = {'class_table': UCS2LE_CLS,
|
495 |
+
'class_factor': 6,
|
496 |
+
'state_table': UCS2LE_ST,
|
497 |
+
'char_len_table': UCS2LE_CHAR_LEN_TABLE,
|
498 |
+
'name': 'UTF-16LE'}
|
499 |
+
|
500 |
+
# UTF-8
|
501 |
+
|
502 |
+
UTF8_CLS = (
|
503 |
+
1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value
|
504 |
+
1,1,1,1,1,1,0,0, # 08 - 0f
|
505 |
+
1,1,1,1,1,1,1,1, # 10 - 17
|
506 |
+
1,1,1,0,1,1,1,1, # 18 - 1f
|
507 |
+
1,1,1,1,1,1,1,1, # 20 - 27
|
508 |
+
1,1,1,1,1,1,1,1, # 28 - 2f
|
509 |
+
1,1,1,1,1,1,1,1, # 30 - 37
|
510 |
+
1,1,1,1,1,1,1,1, # 38 - 3f
|
511 |
+
1,1,1,1,1,1,1,1, # 40 - 47
|
512 |
+
1,1,1,1,1,1,1,1, # 48 - 4f
|
513 |
+
1,1,1,1,1,1,1,1, # 50 - 57
|
514 |
+
1,1,1,1,1,1,1,1, # 58 - 5f
|
515 |
+
1,1,1,1,1,1,1,1, # 60 - 67
|
516 |
+
1,1,1,1,1,1,1,1, # 68 - 6f
|
517 |
+
1,1,1,1,1,1,1,1, # 70 - 77
|
518 |
+
1,1,1,1,1,1,1,1, # 78 - 7f
|
519 |
+
2,2,2,2,3,3,3,3, # 80 - 87
|
520 |
+
4,4,4,4,4,4,4,4, # 88 - 8f
|
521 |
+
4,4,4,4,4,4,4,4, # 90 - 97
|
522 |
+
4,4,4,4,4,4,4,4, # 98 - 9f
|
523 |
+
5,5,5,5,5,5,5,5, # a0 - a7
|
524 |
+
5,5,5,5,5,5,5,5, # a8 - af
|
525 |
+
5,5,5,5,5,5,5,5, # b0 - b7
|
526 |
+
5,5,5,5,5,5,5,5, # b8 - bf
|
527 |
+
0,0,6,6,6,6,6,6, # c0 - c7
|
528 |
+
6,6,6,6,6,6,6,6, # c8 - cf
|
529 |
+
6,6,6,6,6,6,6,6, # d0 - d7
|
530 |
+
6,6,6,6,6,6,6,6, # d8 - df
|
531 |
+
7,8,8,8,8,8,8,8, # e0 - e7
|
532 |
+
8,8,8,8,8,9,8,8, # e8 - ef
|
533 |
+
10,11,11,11,11,11,11,11, # f0 - f7
|
534 |
+
12,13,13,13,14,15,0,0 # f8 - ff
|
535 |
+
)
|
536 |
+
|
537 |
+
UTF8_ST = (
|
538 |
+
MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07
|
539 |
+
9, 11, 8, 7, 6, 5, 4, 3,#08-0f
|
540 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
|
541 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
542 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27
|
543 |
+
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f
|
544 |
+
MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37
|
545 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f
|
546 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47
|
547 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f
|
548 |
+
MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57
|
549 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f
|
550 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67
|
551 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f
|
552 |
+
MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77
|
553 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f
|
554 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87
|
555 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f
|
556 |
+
MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97
|
557 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f
|
558 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7
|
559 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af
|
560 |
+
MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7
|
561 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf
|
562 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7
|
563 |
+
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf
|
564 |
+
)
|
565 |
+
|
566 |
+
UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)
|
567 |
+
|
568 |
+
UTF8_SM_MODEL = {'class_table': UTF8_CLS,
|
569 |
+
'class_factor': 16,
|
570 |
+
'state_table': UTF8_ST,
|
571 |
+
'char_len_table': UTF8_CHAR_LEN_TABLE,
|
572 |
+
'name': 'UTF-8'}
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/sbcsgroupprober.py
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is Mozilla Universal charset detector code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 2001
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
# Shy Shalom - original C code
|
12 |
+
#
|
13 |
+
# This library is free software; you can redistribute it and/or
|
14 |
+
# modify it under the terms of the GNU Lesser General Public
|
15 |
+
# License as published by the Free Software Foundation; either
|
16 |
+
# version 2.1 of the License, or (at your option) any later version.
|
17 |
+
#
|
18 |
+
# This library is distributed in the hope that it will be useful,
|
19 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
21 |
+
# Lesser General Public License for more details.
|
22 |
+
#
|
23 |
+
# You should have received a copy of the GNU Lesser General Public
|
24 |
+
# License along with this library; if not, write to the Free Software
|
25 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
26 |
+
# 02110-1301 USA
|
27 |
+
######################### END LICENSE BLOCK #########################
|
28 |
+
|
29 |
+
from .charsetgroupprober import CharSetGroupProber
|
30 |
+
from .hebrewprober import HebrewProber
|
31 |
+
from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
|
32 |
+
WINDOWS_1251_BULGARIAN_MODEL)
|
33 |
+
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
|
34 |
+
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
|
35 |
+
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,
|
36 |
+
# WINDOWS_1250_HUNGARIAN_MODEL)
|
37 |
+
from .langrussianmodel import (IBM855_RUSSIAN_MODEL, IBM866_RUSSIAN_MODEL,
|
38 |
+
ISO_8859_5_RUSSIAN_MODEL, KOI8_R_RUSSIAN_MODEL,
|
39 |
+
MACCYRILLIC_RUSSIAN_MODEL,
|
40 |
+
WINDOWS_1251_RUSSIAN_MODEL)
|
41 |
+
from .langthaimodel import TIS_620_THAI_MODEL
|
42 |
+
from .langturkishmodel import ISO_8859_9_TURKISH_MODEL
|
43 |
+
from .sbcharsetprober import SingleByteCharSetProber
|
44 |
+
|
45 |
+
|
46 |
+
class SBCSGroupProber(CharSetGroupProber):
|
47 |
+
def __init__(self):
|
48 |
+
super(SBCSGroupProber, self).__init__()
|
49 |
+
hebrew_prober = HebrewProber()
|
50 |
+
logical_hebrew_prober = SingleByteCharSetProber(WINDOWS_1255_HEBREW_MODEL,
|
51 |
+
False, hebrew_prober)
|
52 |
+
# TODO: See if using ISO-8859-8 Hebrew model works better here, since
|
53 |
+
# it's actually the visual one
|
54 |
+
visual_hebrew_prober = SingleByteCharSetProber(WINDOWS_1255_HEBREW_MODEL,
|
55 |
+
True, hebrew_prober)
|
56 |
+
hebrew_prober.set_model_probers(logical_hebrew_prober,
|
57 |
+
visual_hebrew_prober)
|
58 |
+
# TODO: ORDER MATTERS HERE. I changed the order vs what was in master
|
59 |
+
# and several tests failed that did not before. Some thought
|
60 |
+
# should be put into the ordering, and we should consider making
|
61 |
+
# order not matter here, because that is very counter-intuitive.
|
62 |
+
self.probers = [
|
63 |
+
SingleByteCharSetProber(WINDOWS_1251_RUSSIAN_MODEL),
|
64 |
+
SingleByteCharSetProber(KOI8_R_RUSSIAN_MODEL),
|
65 |
+
SingleByteCharSetProber(ISO_8859_5_RUSSIAN_MODEL),
|
66 |
+
SingleByteCharSetProber(MACCYRILLIC_RUSSIAN_MODEL),
|
67 |
+
SingleByteCharSetProber(IBM866_RUSSIAN_MODEL),
|
68 |
+
SingleByteCharSetProber(IBM855_RUSSIAN_MODEL),
|
69 |
+
SingleByteCharSetProber(ISO_8859_7_GREEK_MODEL),
|
70 |
+
SingleByteCharSetProber(WINDOWS_1253_GREEK_MODEL),
|
71 |
+
SingleByteCharSetProber(ISO_8859_5_BULGARIAN_MODEL),
|
72 |
+
SingleByteCharSetProber(WINDOWS_1251_BULGARIAN_MODEL),
|
73 |
+
# TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250)
|
74 |
+
# after we retrain model.
|
75 |
+
# SingleByteCharSetProber(ISO_8859_2_HUNGARIAN_MODEL),
|
76 |
+
# SingleByteCharSetProber(WINDOWS_1250_HUNGARIAN_MODEL),
|
77 |
+
SingleByteCharSetProber(TIS_620_THAI_MODEL),
|
78 |
+
SingleByteCharSetProber(ISO_8859_9_TURKISH_MODEL),
|
79 |
+
hebrew_prober,
|
80 |
+
logical_hebrew_prober,
|
81 |
+
visual_hebrew_prober,
|
82 |
+
]
|
83 |
+
self.reset()
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/chardet/sjisprober.py
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
######################## BEGIN LICENSE BLOCK ########################
|
2 |
+
# The Original Code is mozilla.org code.
|
3 |
+
#
|
4 |
+
# The Initial Developer of the Original Code is
|
5 |
+
# Netscape Communications Corporation.
|
6 |
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
+
# the Initial Developer. All Rights Reserved.
|
8 |
+
#
|
9 |
+
# Contributor(s):
|
10 |
+
# Mark Pilgrim - port to Python
|
11 |
+
#
|
12 |
+
# This library is free software; you can redistribute it and/or
|
13 |
+
# modify it under the terms of the GNU Lesser General Public
|
14 |
+
# License as published by the Free Software Foundation; either
|
15 |
+
# version 2.1 of the License, or (at your option) any later version.
|
16 |
+
#
|
17 |
+
# This library is distributed in the hope that it will be useful,
|
18 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
+
# Lesser General Public License for more details.
|
21 |
+
#
|
22 |
+
# You should have received a copy of the GNU Lesser General Public
|
23 |
+
# License along with this library; if not, write to the Free Software
|
24 |
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
+
# 02110-1301 USA
|
26 |
+
######################### END LICENSE BLOCK #########################
|
27 |
+
|
28 |
+
from .mbcharsetprober import MultiByteCharSetProber
|
29 |
+
from .codingstatemachine import CodingStateMachine
|
30 |
+
from .chardistribution import SJISDistributionAnalysis
|
31 |
+
from .jpcntx import SJISContextAnalysis
|
32 |
+
from .mbcssm import SJIS_SM_MODEL
|
33 |
+
from .enums import ProbingState, MachineState
|
34 |
+
|
35 |
+
|
36 |
+
class SJISProber(MultiByteCharSetProber):
|
37 |
+
def __init__(self):
|
38 |
+
super(SJISProber, self).__init__()
|
39 |
+
self.coding_sm = CodingStateMachine(SJIS_SM_MODEL)
|
40 |
+
self.distribution_analyzer = SJISDistributionAnalysis()
|
41 |
+
self.context_analyzer = SJISContextAnalysis()
|
42 |
+
self.reset()
|
43 |
+
|
44 |
+
def reset(self):
|
45 |
+
super(SJISProber, self).reset()
|
46 |
+
self.context_analyzer.reset()
|
47 |
+
|
48 |
+
@property
|
49 |
+
def charset_name(self):
|
50 |
+
return self.context_analyzer.charset_name
|
51 |
+
|
52 |
+
@property
|
53 |
+
def language(self):
|
54 |
+
return "Japanese"
|
55 |
+
|
56 |
+
def feed(self, byte_str):
|
57 |
+
for i in range(len(byte_str)):
|
58 |
+
coding_state = self.coding_sm.next_state(byte_str[i])
|
59 |
+
if coding_state == MachineState.ERROR:
|
60 |
+
self.logger.debug('%s %s prober hit error at byte %s',
|
61 |
+
self.charset_name, self.language, i)
|
62 |
+
self._state = ProbingState.NOT_ME
|
63 |
+
break
|
64 |
+
elif coding_state == MachineState.ITS_ME:
|
65 |
+
self._state = ProbingState.FOUND_IT
|
66 |
+
break
|
67 |
+
elif coding_state == MachineState.START:
|
68 |
+
char_len = self.coding_sm.get_current_charlen()
|
69 |
+
if i == 0:
|
70 |
+
self._last_char[1] = byte_str[0]
|
71 |
+
self.context_analyzer.feed(self._last_char[2 - char_len:],
|
72 |
+
char_len)
|
73 |
+
self.distribution_analyzer.feed(self._last_char, char_len)
|
74 |
+
else:
|
75 |
+
self.context_analyzer.feed(byte_str[i + 1 - char_len:i + 3
|
76 |
+
- char_len], char_len)
|
77 |
+
self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
|
78 |
+
char_len)
|
79 |
+
|
80 |
+
self._last_char[0] = byte_str[-1]
|
81 |
+
|
82 |
+
if self.state == ProbingState.DETECTING:
|
83 |
+
if (self.context_analyzer.got_enough_data() and
|
84 |
+
(self.get_confidence() > self.SHORTCUT_THRESHOLD)):
|
85 |
+
self._state = ProbingState.FOUND_IT
|
86 |
+
|
87 |
+
return self.state
|
88 |
+
|
89 |
+
def get_confidence(self):
|
90 |
+
context_conf = self.context_analyzer.get_confidence()
|
91 |
+
distrib_conf = self.distribution_analyzer.get_confidence()
|
92 |
+
return max(context_conf, distrib_conf)
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/distlib/__init__.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
#
|
3 |
+
# Copyright (C) 2012-2019 Vinay Sajip.
|
4 |
+
# Licensed to the Python Software Foundation under a contributor agreement.
|
5 |
+
# See LICENSE.txt and CONTRIBUTORS.txt.
|
6 |
+
#
|
7 |
+
import logging
|
8 |
+
|
9 |
+
__version__ = '0.3.4'
|
10 |
+
|
11 |
+
class DistlibException(Exception):
|
12 |
+
pass
|
13 |
+
|
14 |
+
try:
|
15 |
+
from logging import NullHandler
|
16 |
+
except ImportError: # pragma: no cover
|
17 |
+
class NullHandler(logging.Handler):
|
18 |
+
def handle(self, record): pass
|
19 |
+
def emit(self, record): pass
|
20 |
+
def createLock(self): self.lock = None
|
21 |
+
|
22 |
+
logger = logging.getLogger(__name__)
|
23 |
+
logger.addHandler(NullHandler())
|
llmeval-env/lib/python3.10/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (1.06 kB). View file
|
|