diff --git a/.gitattributes b/.gitattributes index 3d1a48c02593a996f8bae4bd3e2af07f1648e028..636d8530afcb72d184f17dba7383f59838e678d6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -155,3 +155,4 @@ parrot/lib/python3.10/site-packages/wandb/sdk/__pycache__/wandb_run.cpython-310. parrot/lib/python3.10/site-packages/wandb/sdk/internal/__pycache__/internal_api.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text parrot/lib/libgomp.so.1 filter=lfs diff=lfs merge=lfs -text parrot/lib/python3.10/site-packages/huggingface_hub/inference/_generated/__pycache__/_async_client.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text +parrot/lib/libquadmath.so.0.0.0 filter=lfs diff=lfs merge=lfs -text diff --git a/parrot/lib/libquadmath.so.0.0.0 b/parrot/lib/libquadmath.so.0.0.0 new file mode 100644 index 0000000000000000000000000000000000000000..cd082c15339041642f25b85e32bd65b9e0393619 --- /dev/null +++ b/parrot/lib/libquadmath.so.0.0.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10c6fadba4c2f6d77e836a50aadbd92e95b137a85eb01b1ca183b50d8f39a2c6 +size 1009408 diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/__init__.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d30c8f82de88bc88701d8984718c834fa85263b4 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/__init__.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/cmd.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/cmd.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac60fdc318a12af4c93ad4d19db280cbe2ac2906 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/cmd.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/compat.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/compat.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa88f77cfcdc68dfa207ec03f7d7f61bc5ad060f Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/compat.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/db.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/db.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e7fb12f7eb30781d700a2e934c297c574ec7840 Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/db.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/exc.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/exc.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8743a0b64ef5d45f3adb2de549e9bf27eab4c8fa Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/exc.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/remote.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/remote.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2040dd97fba1ef0acf54b3ae57abf47aa38ec46f Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/remote.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/__pycache__/types.cpython-310.pyc b/parrot/lib/python3.10/site-packages/git/__pycache__/types.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d9337b41cd86a20ebf0fc3c363fc977a701ab7f Binary files /dev/null and b/parrot/lib/python3.10/site-packages/git/__pycache__/types.cpython-310.pyc differ diff --git a/parrot/lib/python3.10/site-packages/git/config.py b/parrot/lib/python3.10/site-packages/git/config.py new file mode 100644 index 0000000000000000000000000000000000000000..3ce9b123f920bdefb127f696b6a01543ed3c9e65 --- /dev/null +++ b/parrot/lib/python3.10/site-packages/git/config.py @@ -0,0 +1,944 @@ +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under the +# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ + +"""Parser for reading and writing configuration files.""" + +__all__ = ["GitConfigParser", "SectionConstraint"] + +import abc +import configparser as cp +import fnmatch +from functools import wraps +import inspect +from io import BufferedReader, IOBase +import logging +import os +import os.path as osp +import re +import sys + +from git.compat import defenc, force_text +from git.util import LockFile + +# typing------------------------------------------------------- + +from typing import ( + Any, + Callable, + Generic, + IO, + List, + Dict, + Sequence, + TYPE_CHECKING, + Tuple, + TypeVar, + Union, + cast, +) + +from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T + +if TYPE_CHECKING: + from io import BytesIO + + from git.repo.base import Repo + +T_ConfigParser = TypeVar("T_ConfigParser", bound="GitConfigParser") +T_OMD_value = TypeVar("T_OMD_value", str, bytes, int, float, bool) + +if sys.version_info[:3] < (3, 7, 2): + # typing.Ordereddict not added until Python 3.7.2. + from collections import OrderedDict + + OrderedDict_OMD = OrderedDict +else: + from typing import OrderedDict + + OrderedDict_OMD = OrderedDict[str, List[T_OMD_value]] # type: ignore[assignment, misc] + +# ------------------------------------------------------------- + +_logger = logging.getLogger(__name__) + +CONFIG_LEVELS: ConfigLevels_Tup = ("system", "user", "global", "repository") +"""The configuration level of a configuration file.""" + +CONDITIONAL_INCLUDE_REGEXP = re.compile(r"(?<=includeIf )\"(gitdir|gitdir/i|onbranch):(.+)\"") +"""Section pattern to detect conditional includes. + +See: https://git-scm.com/docs/git-config#_conditional_includes +""" + + +class MetaParserBuilder(abc.ABCMeta): # noqa: B024 + """Utility class wrapping base-class methods into decorators that assure read-only + properties.""" + + def __new__(cls, name: str, bases: Tuple, clsdict: Dict[str, Any]) -> "MetaParserBuilder": + """Equip all base-class methods with a needs_values decorator, and all non-const + methods with a :func:`set_dirty_and_flush_changes` decorator in addition to + that. + """ + kmm = "_mutating_methods_" + if kmm in clsdict: + mutating_methods = clsdict[kmm] + for base in bases: + methods = (t for t in inspect.getmembers(base, inspect.isroutine) if not t[0].startswith("_")) + for name, method in methods: + if name in clsdict: + continue + method_with_values = needs_values(method) + if name in mutating_methods: + method_with_values = set_dirty_and_flush_changes(method_with_values) + # END mutating methods handling + + clsdict[name] = method_with_values + # END for each name/method pair + # END for each base + # END if mutating methods configuration is set + + new_type = super().__new__(cls, name, bases, clsdict) + return new_type + + +def needs_values(func: Callable[..., _T]) -> Callable[..., _T]: + """Return a method for ensuring we read values (on demand) before we try to access + them.""" + + @wraps(func) + def assure_data_present(self: "GitConfigParser", *args: Any, **kwargs: Any) -> _T: + self.read() + return func(self, *args, **kwargs) + + # END wrapper method + return assure_data_present + + +def set_dirty_and_flush_changes(non_const_func: Callable[..., _T]) -> Callable[..., _T]: + """Return a method that checks whether given non constant function may be called. + + If so, the instance will be set dirty. Additionally, we flush the changes right to + disk. + """ + + def flush_changes(self: "GitConfigParser", *args: Any, **kwargs: Any) -> _T: + rval = non_const_func(self, *args, **kwargs) + self._dirty = True + self.write() + return rval + + # END wrapper method + flush_changes.__name__ = non_const_func.__name__ + return flush_changes + + +class SectionConstraint(Generic[T_ConfigParser]): + """Constrains a ConfigParser to only option commands which are constrained to + always use the section we have been initialized with. + + It supports all ConfigParser methods that operate on an option. + + :note: + If used as a context manager, will release the wrapped ConfigParser. + """ + + __slots__ = ("_config", "_section_name") + + _valid_attrs_ = ( + "get_value", + "set_value", + "get", + "set", + "getint", + "getfloat", + "getboolean", + "has_option", + "remove_section", + "remove_option", + "options", + ) + + def __init__(self, config: T_ConfigParser, section: str) -> None: + self._config = config + self._section_name = section + + def __del__(self) -> None: + # Yes, for some reason, we have to call it explicitly for it to work in PY3 ! + # Apparently __del__ doesn't get call anymore if refcount becomes 0 + # Ridiculous ... . + self._config.release() + + def __getattr__(self, attr: str) -> Any: + if attr in self._valid_attrs_: + return lambda *args, **kwargs: self._call_config(attr, *args, **kwargs) + return super().__getattribute__(attr) + + def _call_config(self, method: str, *args: Any, **kwargs: Any) -> Any: + """Call the configuration at the given method which must take a section name as + first argument.""" + return getattr(self._config, method)(self._section_name, *args, **kwargs) + + @property + def config(self) -> T_ConfigParser: + """return: ConfigParser instance we constrain""" + return self._config + + def release(self) -> None: + """Equivalent to :meth:`GitConfigParser.release`, which is called on our + underlying parser instance.""" + return self._config.release() + + def __enter__(self) -> "SectionConstraint[T_ConfigParser]": + self._config.__enter__() + return self + + def __exit__(self, exception_type: str, exception_value: str, traceback: str) -> None: + self._config.__exit__(exception_type, exception_value, traceback) + + +class _OMD(OrderedDict_OMD): + """Ordered multi-dict.""" + + def __setitem__(self, key: str, value: _T) -> None: + super().__setitem__(key, [value]) + + def add(self, key: str, value: Any) -> None: + if key not in self: + super().__setitem__(key, [value]) + return + + super().__getitem__(key).append(value) + + def setall(self, key: str, values: List[_T]) -> None: + super().__setitem__(key, values) + + def __getitem__(self, key: str) -> Any: + return super().__getitem__(key)[-1] + + def getlast(self, key: str) -> Any: + return super().__getitem__(key)[-1] + + def setlast(self, key: str, value: Any) -> None: + if key not in self: + super().__setitem__(key, [value]) + return + + prior = super().__getitem__(key) + prior[-1] = value + + def get(self, key: str, default: Union[_T, None] = None) -> Union[_T, None]: + return super().get(key, [default])[-1] + + def getall(self, key: str) -> List[_T]: + return super().__getitem__(key) + + def items(self) -> List[Tuple[str, _T]]: # type: ignore[override] + """List of (key, last value for key).""" + return [(k, self[k]) for k in self] + + def items_all(self) -> List[Tuple[str, List[_T]]]: + """List of (key, list of values for key).""" + return [(k, self.getall(k)) for k in self] + + +def get_config_path(config_level: Lit_config_levels) -> str: + # We do not support an absolute path of the gitconfig on Windows. + # Use the global config instead. + if sys.platform == "win32" and config_level == "system": + config_level = "global" + + if config_level == "system": + return "/etc/gitconfig" + elif config_level == "user": + config_home = os.environ.get("XDG_CONFIG_HOME") or osp.join(os.environ.get("HOME", "~"), ".config") + return osp.normpath(osp.expanduser(osp.join(config_home, "git", "config"))) + elif config_level == "global": + return osp.normpath(osp.expanduser("~/.gitconfig")) + elif config_level == "repository": + raise ValueError("No repo to get repository configuration from. Use Repo._get_config_path") + else: + # Should not reach here. Will raise ValueError if does. Static typing will warn + # about missing elifs. + assert_never( # type: ignore[unreachable] + config_level, + ValueError(f"Invalid configuration level: {config_level!r}"), + ) + + +class GitConfigParser(cp.RawConfigParser, metaclass=MetaParserBuilder): + """Implements specifics required to read git style configuration files. + + This variation behaves much like the :manpage:`git-config(1)` command, such that the + configuration will be read on demand based on the filepath given during + initialization. + + The changes will automatically be written once the instance goes out of scope, but + can be triggered manually as well. + + The configuration file will be locked if you intend to change values preventing + other instances to write concurrently. + + :note: + The config is case-sensitive even when queried, hence section and option names + must match perfectly. + + :note: + If used as a context manager, this will release the locked file. + """ + + # { Configuration + t_lock = LockFile + """The lock type determines the type of lock to use in new configuration readers. + + They must be compatible to the :class:`~git.util.LockFile` interface. + A suitable alternative would be the :class:`~git.util.BlockingLockFile`. + """ + + re_comment = re.compile(r"^\s*[#;]") + # } END configuration + + optvalueonly_source = r"\s*(?P