Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- venv/lib/python3.13/site-packages/certifi-2025.11.12.dist-info/licenses/LICENSE +20 -0
- venv/lib/python3.13/site-packages/certifi/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/certifi/__pycache__/__main__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/certifi/__pycache__/core.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__main__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/cd.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/constant.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/legacy.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/md.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/models.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/utils.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/version.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__init__.py +8 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__main__.py +381 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__main__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock-3.20.0.dist-info/licenses/LICENSE +24 -0
- venv/lib/python3.13/site-packages/hf_xet-1.2.0.dist-info/licenses/LICENSE +201 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_commit_api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_commit_scheduler.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_inference_endpoints.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_jobs_api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_local_folder.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_login.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_oauth.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_snapshot_download.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_space_api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_tensorboard_logger.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_upload_large_folder.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_webhooks_payload.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_webhooks_server.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/community.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/constants.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/dataclasses.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/errors.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/fastai_utils.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/file_download.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/hf_file_system.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/hub_mixin.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/inference_api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/keras_mixin.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/lfs.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repocard.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repocard_data.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repository.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/huggingface_hub/cli/__init__.py +27 -0
- venv/lib/python3.13/site-packages/huggingface_hub/cli/_cli_utils.py +69 -0
venv/lib/python3.13/site-packages/certifi-2025.11.12.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This package contains a modified version of ca-bundle.crt:
|
| 2 |
+
|
| 3 |
+
ca-bundle.crt -- Bundle of CA Root Certificates
|
| 4 |
+
|
| 5 |
+
This is a bundle of X.509 certificates of public Certificate Authorities
|
| 6 |
+
(CA). These were automatically extracted from Mozilla's root certificates
|
| 7 |
+
file (certdata.txt). This file can be found in the mozilla source tree:
|
| 8 |
+
https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
|
| 9 |
+
It contains the certificates in PEM format and therefore
|
| 10 |
+
can be directly used with curl / libcurl / php_curl, or with
|
| 11 |
+
an Apache+mod_ssl webserver for SSL client authentication.
|
| 12 |
+
Just configure this file as the SSLCACertificateFile.#
|
| 13 |
+
|
| 14 |
+
***** BEGIN LICENSE BLOCK *****
|
| 15 |
+
This Source Code Form is subject to the terms of the Mozilla Public License,
|
| 16 |
+
v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
|
| 17 |
+
one at http://mozilla.org/MPL/2.0/.
|
| 18 |
+
|
| 19 |
+
***** END LICENSE BLOCK *****
|
| 20 |
+
@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
|
venv/lib/python3.13/site-packages/certifi/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (297 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/certifi/__pycache__/__main__.cpython-313.pyc
ADDED
|
Binary file (614 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/certifi/__pycache__/core.cpython-313.pyc
ADDED
|
Binary file (2.05 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (1.76 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__main__.cpython-313.pyc
ADDED
|
Binary file (340 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/api.cpython-313.pyc
ADDED
|
Binary file (18.7 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/cd.cpython-313.pyc
ADDED
|
Binary file (13.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/constant.cpython-313.pyc
ADDED
|
Binary file (40.8 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/legacy.cpython-313.pyc
ADDED
|
Binary file (3.11 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/md.cpython-313.pyc
ADDED
|
Binary file (25.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/models.cpython-313.pyc
ADDED
|
Binary file (17.3 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/utils.cpython-313.pyc
ADDED
|
Binary file (14 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/version.cpython-313.pyc
ADDED
|
Binary file (365 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from .__main__ import cli_detect, query_yes_no
|
| 4 |
+
|
| 5 |
+
__all__ = (
|
| 6 |
+
"cli_detect",
|
| 7 |
+
"query_yes_no",
|
| 8 |
+
)
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__main__.py
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import sys
|
| 5 |
+
import typing
|
| 6 |
+
from json import dumps
|
| 7 |
+
from os.path import abspath, basename, dirname, join, realpath
|
| 8 |
+
from platform import python_version
|
| 9 |
+
from unicodedata import unidata_version
|
| 10 |
+
|
| 11 |
+
import charset_normalizer.md as md_module
|
| 12 |
+
from charset_normalizer import from_fp
|
| 13 |
+
from charset_normalizer.models import CliDetectionResult
|
| 14 |
+
from charset_normalizer.version import __version__
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def query_yes_no(question: str, default: str = "yes") -> bool:
|
| 18 |
+
"""Ask a yes/no question via input() and return their answer.
|
| 19 |
+
|
| 20 |
+
"question" is a string that is presented to the user.
|
| 21 |
+
"default" is the presumed answer if the user just hits <Enter>.
|
| 22 |
+
It must be "yes" (the default), "no" or None (meaning
|
| 23 |
+
an answer is required of the user).
|
| 24 |
+
|
| 25 |
+
The "answer" return value is True for "yes" or False for "no".
|
| 26 |
+
|
| 27 |
+
Credit goes to (c) https://stackoverflow.com/questions/3041986/apt-command-line-interface-like-yes-no-input
|
| 28 |
+
"""
|
| 29 |
+
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False}
|
| 30 |
+
if default is None:
|
| 31 |
+
prompt = " [y/n] "
|
| 32 |
+
elif default == "yes":
|
| 33 |
+
prompt = " [Y/n] "
|
| 34 |
+
elif default == "no":
|
| 35 |
+
prompt = " [y/N] "
|
| 36 |
+
else:
|
| 37 |
+
raise ValueError("invalid default answer: '%s'" % default)
|
| 38 |
+
|
| 39 |
+
while True:
|
| 40 |
+
sys.stdout.write(question + prompt)
|
| 41 |
+
choice = input().lower()
|
| 42 |
+
if default is not None and choice == "":
|
| 43 |
+
return valid[default]
|
| 44 |
+
elif choice in valid:
|
| 45 |
+
return valid[choice]
|
| 46 |
+
else:
|
| 47 |
+
sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n")
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class FileType:
|
| 51 |
+
"""Factory for creating file object types
|
| 52 |
+
|
| 53 |
+
Instances of FileType are typically passed as type= arguments to the
|
| 54 |
+
ArgumentParser add_argument() method.
|
| 55 |
+
|
| 56 |
+
Keyword Arguments:
|
| 57 |
+
- mode -- A string indicating how the file is to be opened. Accepts the
|
| 58 |
+
same values as the builtin open() function.
|
| 59 |
+
- bufsize -- The file's desired buffer size. Accepts the same values as
|
| 60 |
+
the builtin open() function.
|
| 61 |
+
- encoding -- The file's encoding. Accepts the same values as the
|
| 62 |
+
builtin open() function.
|
| 63 |
+
- errors -- A string indicating how encoding and decoding errors are to
|
| 64 |
+
be handled. Accepts the same value as the builtin open() function.
|
| 65 |
+
|
| 66 |
+
Backported from CPython 3.12
|
| 67 |
+
"""
|
| 68 |
+
|
| 69 |
+
def __init__(
|
| 70 |
+
self,
|
| 71 |
+
mode: str = "r",
|
| 72 |
+
bufsize: int = -1,
|
| 73 |
+
encoding: str | None = None,
|
| 74 |
+
errors: str | None = None,
|
| 75 |
+
):
|
| 76 |
+
self._mode = mode
|
| 77 |
+
self._bufsize = bufsize
|
| 78 |
+
self._encoding = encoding
|
| 79 |
+
self._errors = errors
|
| 80 |
+
|
| 81 |
+
def __call__(self, string: str) -> typing.IO: # type: ignore[type-arg]
|
| 82 |
+
# the special argument "-" means sys.std{in,out}
|
| 83 |
+
if string == "-":
|
| 84 |
+
if "r" in self._mode:
|
| 85 |
+
return sys.stdin.buffer if "b" in self._mode else sys.stdin
|
| 86 |
+
elif any(c in self._mode for c in "wax"):
|
| 87 |
+
return sys.stdout.buffer if "b" in self._mode else sys.stdout
|
| 88 |
+
else:
|
| 89 |
+
msg = f'argument "-" with mode {self._mode}'
|
| 90 |
+
raise ValueError(msg)
|
| 91 |
+
|
| 92 |
+
# all other arguments are used as file names
|
| 93 |
+
try:
|
| 94 |
+
return open(string, self._mode, self._bufsize, self._encoding, self._errors)
|
| 95 |
+
except OSError as e:
|
| 96 |
+
message = f"can't open '{string}': {e}"
|
| 97 |
+
raise argparse.ArgumentTypeError(message)
|
| 98 |
+
|
| 99 |
+
def __repr__(self) -> str:
|
| 100 |
+
args = self._mode, self._bufsize
|
| 101 |
+
kwargs = [("encoding", self._encoding), ("errors", self._errors)]
|
| 102 |
+
args_str = ", ".join(
|
| 103 |
+
[repr(arg) for arg in args if arg != -1]
|
| 104 |
+
+ [f"{kw}={arg!r}" for kw, arg in kwargs if arg is not None]
|
| 105 |
+
)
|
| 106 |
+
return f"{type(self).__name__}({args_str})"
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def cli_detect(argv: list[str] | None = None) -> int:
|
| 110 |
+
"""
|
| 111 |
+
CLI assistant using ARGV and ArgumentParser
|
| 112 |
+
:param argv:
|
| 113 |
+
:return: 0 if everything is fine, anything else equal trouble
|
| 114 |
+
"""
|
| 115 |
+
parser = argparse.ArgumentParser(
|
| 116 |
+
description="The Real First Universal Charset Detector. "
|
| 117 |
+
"Discover originating encoding used on text file. "
|
| 118 |
+
"Normalize text to unicode."
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
parser.add_argument(
|
| 122 |
+
"files", type=FileType("rb"), nargs="+", help="File(s) to be analysed"
|
| 123 |
+
)
|
| 124 |
+
parser.add_argument(
|
| 125 |
+
"-v",
|
| 126 |
+
"--verbose",
|
| 127 |
+
action="store_true",
|
| 128 |
+
default=False,
|
| 129 |
+
dest="verbose",
|
| 130 |
+
help="Display complementary information about file if any. "
|
| 131 |
+
"Stdout will contain logs about the detection process.",
|
| 132 |
+
)
|
| 133 |
+
parser.add_argument(
|
| 134 |
+
"-a",
|
| 135 |
+
"--with-alternative",
|
| 136 |
+
action="store_true",
|
| 137 |
+
default=False,
|
| 138 |
+
dest="alternatives",
|
| 139 |
+
help="Output complementary possibilities if any. Top-level JSON WILL be a list.",
|
| 140 |
+
)
|
| 141 |
+
parser.add_argument(
|
| 142 |
+
"-n",
|
| 143 |
+
"--normalize",
|
| 144 |
+
action="store_true",
|
| 145 |
+
default=False,
|
| 146 |
+
dest="normalize",
|
| 147 |
+
help="Permit to normalize input file. If not set, program does not write anything.",
|
| 148 |
+
)
|
| 149 |
+
parser.add_argument(
|
| 150 |
+
"-m",
|
| 151 |
+
"--minimal",
|
| 152 |
+
action="store_true",
|
| 153 |
+
default=False,
|
| 154 |
+
dest="minimal",
|
| 155 |
+
help="Only output the charset detected to STDOUT. Disabling JSON output.",
|
| 156 |
+
)
|
| 157 |
+
parser.add_argument(
|
| 158 |
+
"-r",
|
| 159 |
+
"--replace",
|
| 160 |
+
action="store_true",
|
| 161 |
+
default=False,
|
| 162 |
+
dest="replace",
|
| 163 |
+
help="Replace file when trying to normalize it instead of creating a new one.",
|
| 164 |
+
)
|
| 165 |
+
parser.add_argument(
|
| 166 |
+
"-f",
|
| 167 |
+
"--force",
|
| 168 |
+
action="store_true",
|
| 169 |
+
default=False,
|
| 170 |
+
dest="force",
|
| 171 |
+
help="Replace file without asking if you are sure, use this flag with caution.",
|
| 172 |
+
)
|
| 173 |
+
parser.add_argument(
|
| 174 |
+
"-i",
|
| 175 |
+
"--no-preemptive",
|
| 176 |
+
action="store_true",
|
| 177 |
+
default=False,
|
| 178 |
+
dest="no_preemptive",
|
| 179 |
+
help="Disable looking at a charset declaration to hint the detector.",
|
| 180 |
+
)
|
| 181 |
+
parser.add_argument(
|
| 182 |
+
"-t",
|
| 183 |
+
"--threshold",
|
| 184 |
+
action="store",
|
| 185 |
+
default=0.2,
|
| 186 |
+
type=float,
|
| 187 |
+
dest="threshold",
|
| 188 |
+
help="Define a custom maximum amount of noise allowed in decoded content. 0. <= noise <= 1.",
|
| 189 |
+
)
|
| 190 |
+
parser.add_argument(
|
| 191 |
+
"--version",
|
| 192 |
+
action="version",
|
| 193 |
+
version="Charset-Normalizer {} - Python {} - Unicode {} - SpeedUp {}".format(
|
| 194 |
+
__version__,
|
| 195 |
+
python_version(),
|
| 196 |
+
unidata_version,
|
| 197 |
+
"OFF" if md_module.__file__.lower().endswith(".py") else "ON",
|
| 198 |
+
),
|
| 199 |
+
help="Show version information and exit.",
|
| 200 |
+
)
|
| 201 |
+
|
| 202 |
+
args = parser.parse_args(argv)
|
| 203 |
+
|
| 204 |
+
if args.replace is True and args.normalize is False:
|
| 205 |
+
if args.files:
|
| 206 |
+
for my_file in args.files:
|
| 207 |
+
my_file.close()
|
| 208 |
+
print("Use --replace in addition of --normalize only.", file=sys.stderr)
|
| 209 |
+
return 1
|
| 210 |
+
|
| 211 |
+
if args.force is True and args.replace is False:
|
| 212 |
+
if args.files:
|
| 213 |
+
for my_file in args.files:
|
| 214 |
+
my_file.close()
|
| 215 |
+
print("Use --force in addition of --replace only.", file=sys.stderr)
|
| 216 |
+
return 1
|
| 217 |
+
|
| 218 |
+
if args.threshold < 0.0 or args.threshold > 1.0:
|
| 219 |
+
if args.files:
|
| 220 |
+
for my_file in args.files:
|
| 221 |
+
my_file.close()
|
| 222 |
+
print("--threshold VALUE should be between 0. AND 1.", file=sys.stderr)
|
| 223 |
+
return 1
|
| 224 |
+
|
| 225 |
+
x_ = []
|
| 226 |
+
|
| 227 |
+
for my_file in args.files:
|
| 228 |
+
matches = from_fp(
|
| 229 |
+
my_file,
|
| 230 |
+
threshold=args.threshold,
|
| 231 |
+
explain=args.verbose,
|
| 232 |
+
preemptive_behaviour=args.no_preemptive is False,
|
| 233 |
+
)
|
| 234 |
+
|
| 235 |
+
best_guess = matches.best()
|
| 236 |
+
|
| 237 |
+
if best_guess is None:
|
| 238 |
+
print(
|
| 239 |
+
'Unable to identify originating encoding for "{}". {}'.format(
|
| 240 |
+
my_file.name,
|
| 241 |
+
(
|
| 242 |
+
"Maybe try increasing maximum amount of chaos."
|
| 243 |
+
if args.threshold < 1.0
|
| 244 |
+
else ""
|
| 245 |
+
),
|
| 246 |
+
),
|
| 247 |
+
file=sys.stderr,
|
| 248 |
+
)
|
| 249 |
+
x_.append(
|
| 250 |
+
CliDetectionResult(
|
| 251 |
+
abspath(my_file.name),
|
| 252 |
+
None,
|
| 253 |
+
[],
|
| 254 |
+
[],
|
| 255 |
+
"Unknown",
|
| 256 |
+
[],
|
| 257 |
+
False,
|
| 258 |
+
1.0,
|
| 259 |
+
0.0,
|
| 260 |
+
None,
|
| 261 |
+
True,
|
| 262 |
+
)
|
| 263 |
+
)
|
| 264 |
+
else:
|
| 265 |
+
x_.append(
|
| 266 |
+
CliDetectionResult(
|
| 267 |
+
abspath(my_file.name),
|
| 268 |
+
best_guess.encoding,
|
| 269 |
+
best_guess.encoding_aliases,
|
| 270 |
+
[
|
| 271 |
+
cp
|
| 272 |
+
for cp in best_guess.could_be_from_charset
|
| 273 |
+
if cp != best_guess.encoding
|
| 274 |
+
],
|
| 275 |
+
best_guess.language,
|
| 276 |
+
best_guess.alphabets,
|
| 277 |
+
best_guess.bom,
|
| 278 |
+
best_guess.percent_chaos,
|
| 279 |
+
best_guess.percent_coherence,
|
| 280 |
+
None,
|
| 281 |
+
True,
|
| 282 |
+
)
|
| 283 |
+
)
|
| 284 |
+
|
| 285 |
+
if len(matches) > 1 and args.alternatives:
|
| 286 |
+
for el in matches:
|
| 287 |
+
if el != best_guess:
|
| 288 |
+
x_.append(
|
| 289 |
+
CliDetectionResult(
|
| 290 |
+
abspath(my_file.name),
|
| 291 |
+
el.encoding,
|
| 292 |
+
el.encoding_aliases,
|
| 293 |
+
[
|
| 294 |
+
cp
|
| 295 |
+
for cp in el.could_be_from_charset
|
| 296 |
+
if cp != el.encoding
|
| 297 |
+
],
|
| 298 |
+
el.language,
|
| 299 |
+
el.alphabets,
|
| 300 |
+
el.bom,
|
| 301 |
+
el.percent_chaos,
|
| 302 |
+
el.percent_coherence,
|
| 303 |
+
None,
|
| 304 |
+
False,
|
| 305 |
+
)
|
| 306 |
+
)
|
| 307 |
+
|
| 308 |
+
if args.normalize is True:
|
| 309 |
+
if best_guess.encoding.startswith("utf") is True:
|
| 310 |
+
print(
|
| 311 |
+
'"{}" file does not need to be normalized, as it already came from unicode.'.format(
|
| 312 |
+
my_file.name
|
| 313 |
+
),
|
| 314 |
+
file=sys.stderr,
|
| 315 |
+
)
|
| 316 |
+
if my_file.closed is False:
|
| 317 |
+
my_file.close()
|
| 318 |
+
continue
|
| 319 |
+
|
| 320 |
+
dir_path = dirname(realpath(my_file.name))
|
| 321 |
+
file_name = basename(realpath(my_file.name))
|
| 322 |
+
|
| 323 |
+
o_: list[str] = file_name.split(".")
|
| 324 |
+
|
| 325 |
+
if args.replace is False:
|
| 326 |
+
o_.insert(-1, best_guess.encoding)
|
| 327 |
+
if my_file.closed is False:
|
| 328 |
+
my_file.close()
|
| 329 |
+
elif (
|
| 330 |
+
args.force is False
|
| 331 |
+
and query_yes_no(
|
| 332 |
+
'Are you sure to normalize "{}" by replacing it ?'.format(
|
| 333 |
+
my_file.name
|
| 334 |
+
),
|
| 335 |
+
"no",
|
| 336 |
+
)
|
| 337 |
+
is False
|
| 338 |
+
):
|
| 339 |
+
if my_file.closed is False:
|
| 340 |
+
my_file.close()
|
| 341 |
+
continue
|
| 342 |
+
|
| 343 |
+
try:
|
| 344 |
+
x_[0].unicode_path = join(dir_path, ".".join(o_))
|
| 345 |
+
|
| 346 |
+
with open(x_[0].unicode_path, "wb") as fp:
|
| 347 |
+
fp.write(best_guess.output())
|
| 348 |
+
except OSError as e:
|
| 349 |
+
print(str(e), file=sys.stderr)
|
| 350 |
+
if my_file.closed is False:
|
| 351 |
+
my_file.close()
|
| 352 |
+
return 2
|
| 353 |
+
|
| 354 |
+
if my_file.closed is False:
|
| 355 |
+
my_file.close()
|
| 356 |
+
|
| 357 |
+
if args.minimal is False:
|
| 358 |
+
print(
|
| 359 |
+
dumps(
|
| 360 |
+
[el.__dict__ for el in x_] if len(x_) > 1 else x_[0].__dict__,
|
| 361 |
+
ensure_ascii=True,
|
| 362 |
+
indent=4,
|
| 363 |
+
)
|
| 364 |
+
)
|
| 365 |
+
else:
|
| 366 |
+
for my_file in args.files:
|
| 367 |
+
print(
|
| 368 |
+
", ".join(
|
| 369 |
+
[
|
| 370 |
+
el.encoding or "undefined"
|
| 371 |
+
for el in x_
|
| 372 |
+
if el.path == abspath(my_file.name)
|
| 373 |
+
]
|
| 374 |
+
)
|
| 375 |
+
)
|
| 376 |
+
|
| 377 |
+
return 0
|
| 378 |
+
|
| 379 |
+
|
| 380 |
+
if __name__ == "__main__":
|
| 381 |
+
cli_detect()
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (326 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__main__.cpython-313.pyc
ADDED
|
Binary file (14.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock-3.20.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This is free and unencumbered software released into the public domain.
|
| 2 |
+
|
| 3 |
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
| 4 |
+
distribute this software, either in source code form or as a compiled
|
| 5 |
+
binary, for any purpose, commercial or non-commercial, and by any
|
| 6 |
+
means.
|
| 7 |
+
|
| 8 |
+
In jurisdictions that recognize copyright laws, the author or authors
|
| 9 |
+
of this software dedicate any and all copyright interest in the
|
| 10 |
+
software to the public domain. We make this dedication for the benefit
|
| 11 |
+
of the public at large and to the detriment of our heirs and
|
| 12 |
+
successors. We intend this dedication to be an overt act of
|
| 13 |
+
relinquishment in perpetuity of all present and future rights to this
|
| 14 |
+
software under copyright law.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 19 |
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
| 20 |
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
| 21 |
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 22 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
| 23 |
+
|
| 24 |
+
For more information, please refer to <http://unlicense.org>
|
venv/lib/python3.13/site-packages/hf_xet-1.2.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (22.7 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_commit_api.cpython-313.pyc
ADDED
|
Binary file (42.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_commit_scheduler.cpython-313.pyc
ADDED
|
Binary file (18.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_inference_endpoints.cpython-313.pyc
ADDED
|
Binary file (19.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_jobs_api.cpython-313.pyc
ADDED
|
Binary file (14.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_local_folder.cpython-313.pyc
ADDED
|
Binary file (20.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_login.cpython-313.pyc
ADDED
|
Binary file (21.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_oauth.cpython-313.pyc
ADDED
|
Binary file (20.9 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_snapshot_download.cpython-313.pyc
ADDED
|
Binary file (14.8 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_space_api.cpython-313.pyc
ADDED
|
Binary file (6.35 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_tensorboard_logger.cpython-313.pyc
ADDED
|
Binary file (8.48 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_upload_large_folder.cpython-313.pyc
ADDED
|
Binary file (37.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_webhooks_payload.cpython-313.pyc
ADDED
|
Binary file (5.14 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/_webhooks_server.cpython-313.pyc
ADDED
|
Binary file (17.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/community.cpython-313.pyc
ADDED
|
Binary file (14.8 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/constants.cpython-313.pyc
ADDED
|
Binary file (10.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/dataclasses.cpython-313.pyc
ADDED
|
Binary file (19.9 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/errors.cpython-313.pyc
ADDED
|
Binary file (16.7 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/fastai_utils.cpython-313.pyc
ADDED
|
Binary file (17.6 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/file_download.cpython-313.pyc
ADDED
|
Binary file (71.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/hf_file_system.cpython-313.pyc
ADDED
|
Binary file (51 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/hub_mixin.cpython-313.pyc
ADDED
|
Binary file (37.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/inference_api.cpython-313.pyc
ADDED
|
Binary file (8.74 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/keras_mixin.cpython-313.pyc
ADDED
|
Binary file (20.3 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/lfs.cpython-313.pyc
ADDED
|
Binary file (19.9 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repocard.cpython-313.pyc
ADDED
|
Binary file (34 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repocard_data.cpython-313.pyc
ADDED
|
Binary file (35.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/__pycache__/repository.cpython-313.pyc
ADDED
|
Binary file (64.6 kB). View file
|
|
|
venv/lib/python3.13/site-packages/huggingface_hub/cli/__init__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2025 The HuggingFace Team. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
|
| 15 |
+
from abc import ABC, abstractmethod
|
| 16 |
+
from argparse import _SubParsersAction
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class BaseHuggingfaceCLICommand(ABC):
|
| 20 |
+
@staticmethod
|
| 21 |
+
@abstractmethod
|
| 22 |
+
def register_subcommand(parser: _SubParsersAction):
|
| 23 |
+
raise NotImplementedError()
|
| 24 |
+
|
| 25 |
+
@abstractmethod
|
| 26 |
+
def run(self):
|
| 27 |
+
raise NotImplementedError()
|
venv/lib/python3.13/site-packages/huggingface_hub/cli/_cli_utils.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""Contains a utility for good-looking prints."""
|
| 15 |
+
|
| 16 |
+
import os
|
| 17 |
+
from typing import List, Union
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class ANSI:
|
| 21 |
+
"""
|
| 22 |
+
Helper for en.wikipedia.org/wiki/ANSI_escape_code
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
_bold = "\u001b[1m"
|
| 26 |
+
_gray = "\u001b[90m"
|
| 27 |
+
_red = "\u001b[31m"
|
| 28 |
+
_reset = "\u001b[0m"
|
| 29 |
+
_yellow = "\u001b[33m"
|
| 30 |
+
|
| 31 |
+
@classmethod
|
| 32 |
+
def bold(cls, s: str) -> str:
|
| 33 |
+
return cls._format(s, cls._bold)
|
| 34 |
+
|
| 35 |
+
@classmethod
|
| 36 |
+
def gray(cls, s: str) -> str:
|
| 37 |
+
return cls._format(s, cls._gray)
|
| 38 |
+
|
| 39 |
+
@classmethod
|
| 40 |
+
def red(cls, s: str) -> str:
|
| 41 |
+
return cls._format(s, cls._bold + cls._red)
|
| 42 |
+
|
| 43 |
+
@classmethod
|
| 44 |
+
def yellow(cls, s: str) -> str:
|
| 45 |
+
return cls._format(s, cls._yellow)
|
| 46 |
+
|
| 47 |
+
@classmethod
|
| 48 |
+
def _format(cls, s: str, code: str) -> str:
|
| 49 |
+
if os.environ.get("NO_COLOR"):
|
| 50 |
+
# See https://no-color.org/
|
| 51 |
+
return s
|
| 52 |
+
return f"{code}{s}{cls._reset}"
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def tabulate(rows: List[List[Union[str, int]]], headers: List[str]) -> str:
|
| 56 |
+
"""
|
| 57 |
+
Inspired by:
|
| 58 |
+
|
| 59 |
+
- stackoverflow.com/a/8356620/593036
|
| 60 |
+
- stackoverflow.com/questions/9535954/printing-lists-as-tabular-data
|
| 61 |
+
"""
|
| 62 |
+
col_widths = [max(len(str(x)) for x in col) for col in zip(*rows, headers)]
|
| 63 |
+
row_format = ("{{:{}}} " * len(headers)).format(*col_widths)
|
| 64 |
+
lines = []
|
| 65 |
+
lines.append(row_format.format(*headers))
|
| 66 |
+
lines.append(row_format.format(*["-" * w for w in col_widths]))
|
| 67 |
+
for row in rows:
|
| 68 |
+
lines.append(row_format.format(*row))
|
| 69 |
+
return "\n".join(lines)
|