diff --git a/llmeval-env/lib/python3.10/site-packages/dill-0.3.8.dist-info/INSTALLER b/llmeval-env/lib/python3.10/site-packages/dill-0.3.8.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/dill-0.3.8.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_C.cpython-310-x86_64-linux-gnu.so b/llmeval-env/lib/python3.10/site-packages/functorch/_C.cpython-310-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..ab96acd3fbd9e4e636710d49ec9520f00bab9d6e Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_C.cpython-310-x86_64-linux-gnu.so differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aff35e592d80e510b08ff18a4c3571202b653d6e --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/__init__.py @@ -0,0 +1,38 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import torch + +from torch._functorch.deprecated import ( + combine_state_for_ensemble, + functionalize, + grad, + grad_and_value, + hessian, + jacfwd, + jacrev, + jvp, + make_functional, + make_functional_with_buffers, + vjp, + vmap, +) + +# utilities. Maybe these should go in their own namespace in the future? +from torch._functorch.make_functional import ( + FunctionalModule, + FunctionalModuleWithBuffers, +) + +# Top-level APIs. Please think carefully before adding something to the +# top-level namespace: +# - private helper functions should go into torch._functorch +# - very experimental things should go into functorch.experimental +# - compilation related things should go into functorch.compile + +# Was never documented +from torch._functorch.python_key import make_fx + +__version__ = torch.__version__ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d07fded4493fc68bec3404c092346c1f78cbde67 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/_src/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/_src/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6b4913fbd063e5e499cfb16147326eebd22f1b4 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_src/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94f258df84ba8730208768fc44222bee4b3ebc33 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__init__.py @@ -0,0 +1,8 @@ +# This file has moved to under torch/_functorch. It is not public API. +# If you are not a PyTorch developer and you are relying on the following +# imports, please file an issue. +from torch._functorch.aot_autograd import ( + aot_autograd_decompositions, + KNOWN_TYPES, + PytreeThunk, +) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea4209c2d62ffa092cb7d14c0cb18f1ad99755c1 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_src/aot_autograd/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6052b5548f4af3dbc6d9d45b0ffe72a8d5013d41 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__init__.py @@ -0,0 +1,7 @@ +# This file has moved to under torch/_functorch. It is not public API. +# If you are not a PyTorch developer and you are relying on the following +# imports, please file an issue. +from torch._functorch.eager_transforms import ( + _assert_wrapped_functional, + _unwrap_functional_tensor, +) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b3fb99abbccf74e9af279b1599f8121d0b41a60 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_src/eager_transforms/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3de7787df0c3304207b42b51e9fb62da9d33c7d0 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__init__.py @@ -0,0 +1,4 @@ +# This file has moved to under torch/_functorch. It is not public API. +# If you are not a PyTorch developer and you are relying on the following +# imports, please file an issue. +from torch._functorch.make_functional import _swap_state diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f5a359b3388e14909569c4d0da230f8e5e4bbf3 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_src/make_functional/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dc90517753e50f92362ba954248e31f69f7cfcd5 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__init__.py @@ -0,0 +1,16 @@ +# This file has moved to under torch/_functorch. It is not public API. +# If you are not a PyTorch developer and you are relying on the following +# imports, please file an issue. +from torch._functorch.vmap import ( + _add_batch_dim, + _broadcast_to_and_flatten, + _create_batched_inputs, + _get_name, + _process_batched_inputs, + _remove_batch_dim, + _unwrap_batched, + _validate_and_get_batch_size, + Tensor, + tree_flatten, + tree_unflatten, +) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16dfb9d28c71db1ac10ee8c58bf8ade0da3b0ceb Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/_src/vmap/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/compile/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/compile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..96b853cd2e27e947bf25b63325741637a801426f --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/compile/__init__.py @@ -0,0 +1,31 @@ +from torch._functorch import config +from torch._functorch.aot_autograd import ( + aot_function, + aot_module, + aot_module_simplified, + compiled_function, + compiled_module, + get_aot_compilation_context, + get_aot_graph_name, + get_graph_being_compiled, + make_boxed_compiler, + make_boxed_func, +) +from torch._functorch.compilers import ( + debug_compile, + default_decompositions, + draw_graph_compile, + memory_efficient_fusion, + nnc_jit, + nop, + print_compile, + ts_compile, +) +from torch._functorch.fx_minifier import minifier +from torch._functorch.partitioners import ( + default_partition, + draw_graph, + draw_joint_graph, + min_cut_rematerialization_partition, +) +from torch._functorch.python_key import pythonkey_decompose diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/compile/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/compile/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b4084c7a728ad0e5d3c58b5b5769135da772c5f Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/compile/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..519a7cb271cdc3eef40ccd76c94c504ed1a325e8 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__init__.py @@ -0,0 +1,179 @@ +import dis +import inspect +from typing import Sequence, Union + +import torch + +import functorch._C +from functorch._C import dim as _C +from .tree_map import tree_flatten, tree_map +from .wrap_type import wrap_type + +_C._patch_tensor_class() +dims, DimList, dimlists = _C.dims, _C.DimList, _C.dimlists + + +class DimensionMismatchError(Exception): + pass + + +class DimensionBindError(Exception): + pass + + +from . import op_properties + +# use dict to avoid writing C++ bindings for set +pointwise = dict.fromkeys(op_properties.pointwise, True) + +use_c = True +if not use_c: + from . import reference + + +class _Tensor: + # fast path around slow wrapping/unwrapping logic for simply queries used + # by the implementation... + + @property + def dims(self): + return tuple(d for d in self._levels if isinstance(d, Dim)) + + def dim(self): + return self.ndim + + if use_c: + __torch_function__ = classmethod(_C.__torch_function__) + expand = _C._instancemethod(_C.expand) + else: + __torch_function__ = reference.__torch_function__ + expand = reference.expand + + index = _C._instancemethod(_C.index) + + def __repr__(self): + tensor, levels, ndim = self._tensor, self._levels, self.ndim + return f"{tensor}\nwith dims={tuple(l + ndim if isinstance(l, int) else l for l in levels)} sizes={tuple(tensor.size())}" + + +TensorLike = (_Tensor, torch.Tensor) + + +class Dim(_C.Dim, _Tensor): + # note that _C.Dim comes before tensor because we want the Dim API for things like size to take precendence. + # Tensor defines format, but we want to print Dims with special formatting + __format__ = object.__format__ + + +class Tensor(_Tensor, _C.Tensor): + if not use_c: + from_batched = staticmethod(_C.Tensor_from_batched) + from_positional = staticmethod(_C.Tensor_from_positional) + sum = _C._instancemethod(_C.Tensor_sum) + + +def cat(tensors, dim, new_dim): + n = dims() + return stack(tensors, n, dim).index([n, dim], new_dim) + + +if use_c: + _wrap = _C._wrap + + def _def(name, *args, **kwargs): + orig = getattr(torch.Tensor, name) + setattr(_Tensor, name, _C._instancemethod(_wrap(orig, *args, **kwargs))) + + t__getitem__ = _C._instancemethod(_C.__getitem__) + stack = _C.stack + split = _C._instancemethod(_C.split) +else: + _wrap, _def = reference._wrap, reference._def + t__getitem__ = reference.t__getitem__ + stack = reference.stack + split = reference.split + +# note: there is no python reference +t__setitem__ = _C._instancemethod(_C.__setitem__) +# this is patched in the C API because otherwise torch.Tensor will +# no longer be considered a sequence and things will break +# torch.Tensor.__getitem__ = t__getitem__ + +_Tensor.__getitem__ = t__getitem__ +# torch.Tensor.__setitem__ = t__setitem__ +_Tensor.__setitem__ = t__setitem__ + +torch.Tensor.split = split +_Tensor.split = split +torch.Tensor.expand = _C._instancemethod(_C.expand) +torch.Tensor.index = _C._instancemethod(_C.index) +wrap_type(use_c, _Tensor, torch.Tensor, _Tensor.__torch_function__) +del _Tensor.ndim + +if use_c: + _Tensor.order = _C._instancemethod(_C.order) +else: + _Tensor.order = reference.positional + +_def("mean") +_def("sum") +_def("all") +_def("amax") +_def("amin") +_def("aminmax") +_def("any") +_def("count_nonzero") +_def("logsumexp") +_def("nanmean") +_def("nansum") +_def("prod") +_def("std", keepdim_offset=2) +_def("var", keepdim_offset=2) +_def("max", single_dim=True) +_def("min", single_dim=True) +_def("argmax", single_dim=True) +_def("argmin", single_dim=True) +_def("kthvalue", single_dim=True) +_def("median", single_dim=True) +_def("nanmedian", single_dim=True) +_def("mode", single_dim=True) +_def("sort", reduce=False) +_def("argsort", reduce=False) +_def("unbind", single_dim=True) +_def("chunk", dim_offset=1, reduce=False) +_def("cummax", single_dim=True, reduce=False) +_def("cummin", single_dim=True, reduce=False) +_def("cumprod", single_dim=True, reduce=False) +_def("cumprod_", single_dim=True, reduce=False) +_def("cumsum", single_dim=True, reduce=False) +_def("cumsum_", single_dim=True, reduce=False) +_def("logcumsumexp", single_dim=True, reduce=False) +_def("renorm", dim_offset=1, single_dim=True, reduce=False) +_def("softmax", single_dim=True, reduce=False) +softmax = _wrap(torch.nn.functional.softmax, single_dim=True, reduce=False) + +# stuff to handle in the future, because they require special +# binding logic for dims +# cross +# diag_embed +# diagonal +# diagonal_scatter +# diff +# nanquantile +# quantile +# roll +# rot90 +# topk (new dimes on output) +# should these all be subsumed by inplace indexing? +# index_add_ +# index_add +# index_copy +# index_copy_ +# index_fill +# index_fill_ +# index_select +# scatter +# scatter_ +# scatter_add +# scatter_add_ +# scatter_reduce diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc6f657e078ca013db682a40141264194566a109 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/batch_tensor.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/batch_tensor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d63b52ed0334e88d885a8c02ae885166cc83064e Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/batch_tensor.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/delayed_mul_tensor.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/delayed_mul_tensor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f01c7fca10ddf8ad9cfc6e082b89e9888d43de9a Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/delayed_mul_tensor.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/dim.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/dim.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8391df2fcd8e00fa0a605282e27c03d733526eaa Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/dim.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/magic_trace.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/magic_trace.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d720e4310206a8163bfab3c594b420b85bf67007 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/magic_trace.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/op_properties.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/op_properties.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3753b0e94ba2f8c7baf4688144b2c0107320bce0 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/op_properties.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/reference.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/reference.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9401cb61f41c0dc03da8825bdbf46e5ef4d3d76 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/reference.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/tree_map.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/tree_map.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ea794a9db56bea0a3d5db84d6472128e9e5a5ad Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/tree_map.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/wrap_type.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/wrap_type.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d5c7623312890a42c851d36763b794be5f17e30 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/dim/__pycache__/wrap_type.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/batch_tensor.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/batch_tensor.py new file mode 100644 index 0000000000000000000000000000000000000000..0fc17f2492d5344821071a726a0e3a0e9d5dea95 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/batch_tensor.py @@ -0,0 +1,25 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +from contextlib import contextmanager + +from torch._C._functorch import _vmap_add_layers, _vmap_remove_layers + +_enabled = False + + +@contextmanager +def _enable_layers(dims): + global _enabled + assert not _enabled + input = sorted((d._level, d.size) for d in dims if not isinstance(d, int)) + n = len(input) + try: + _vmap_add_layers(input) + _enabled = True + yield + finally: + _enabled = False + _vmap_remove_layers(n) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/delayed_mul_tensor.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/delayed_mul_tensor.py new file mode 100644 index 0000000000000000000000000000000000000000..3984a063885907141b56bdd2c6e8cc730c592cbb --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/delayed_mul_tensor.py @@ -0,0 +1,77 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import torch + +from . import _Tensor, Tensor +from .reference import _dims, _enable_layers, llist, ltuple + + +class DelayedMulTensor(_Tensor): + def __init__(self, lhs, rhs): + self._lhs, self._rhs = lhs, rhs + self._data = None + self._levels_data = None + self._has_device = lhs._has_device or rhs._has_device + self._batchtensor_data = None + self._tensor_data = None + + @property + def _levels(self): + if self._levels_data is None: + levels = llist(self._lhs._levels) + for l in self._rhs._levels: + if l not in levels: + levels.append(l) + self._levels_data = ltuple(levels) + return self._levels_data + + @property + def _batchtensor(self): + if self._batchtensor_data is None: + with _enable_layers(self._levels): + print("bt multiply fallback") + self._batchtensor_data = self._lhs._batchtensor * self._rhs._batchtensor + return self._batchtensor_data + + @property + def _tensor(self): + if self._tensor_data is None: + self._tensor_data = Tensor.from_batched( + self._batchtensor, self._has_device + )._tensor + return self._tensor_data + + @property + def ndim(self): + return self._batchtensor.ndim + + @property + def dims(self): + return ltuple(super().dims) + + def sum(self, dim): + dims = _dims(dim, 0, False, False) + n = ord("a") + all_levels = self._levels + + def to_char(d): + return chr(n + all_levels.index(d)) + + plhs, levelslhs = self._lhs._tensor, self._lhs._levels + prhs, levelsrhs = self._rhs._tensor, self._rhs._levels + new_dims = tuple(d for d in self.dims if d not in dims) + new_levels = [l for l in self._levels if l not in dims] + fmt = "".join( + [ + *(to_char(d) for d in levelslhs), + ",", + *(to_char(d) for d in levelsrhs), + "->", + *(to_char(d) for d in new_levels), + ] + ) + result_data = torch.einsum(fmt, (plhs, prhs)) + return Tensor.from_positional(result_data, new_levels, True) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/dim.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/dim.py new file mode 100644 index 0000000000000000000000000000000000000000..f8e34af96225f38ce59a4b9b400e399b30c42641 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/dim.py @@ -0,0 +1,121 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import dis +import inspect + +from dataclasses import dataclass +from typing import Union + +from . import DimList + +_vmap_levels = [] + + +@dataclass +class LevelInfo: + level: int + alive: bool = True + + +class Dim: + def __init__(self, name: str, size: Union[None, int] = None): + self.name = name + self._size = None + self._vmap_level = None + if size is not None: + self.size = size + + def __del__(self): + if self._vmap_level is not None: + _vmap_active_levels[self._vmap_stack].alive = False # noqa: F821 + while ( + not _vmap_levels[-1].alive + and current_level() == _vmap_levels[-1].level # noqa: F821 + ): + _vmap_decrement_nesting() # noqa: F821 + _vmap_levels.pop() + + @property + def size(self): + assert self.is_bound + return self._size + + @size.setter + def size(self, size: int): + from . import DimensionBindError + + if self._size is None: + self._size = size + self._vmap_level = _vmap_increment_nesting(size, "same") # noqa: F821 + self._vmap_stack = len(_vmap_levels) + _vmap_levels.append(LevelInfo(self._vmap_level)) + + elif self._size != size: + raise DimensionBindError( + f"Dim '{self}' previously bound to a dimension of size {self._size} cannot bind to a dimension of size {size}" + ) + + @property + def is_bound(self): + return self._size is not None + + def __repr__(self): + return self.name + + +def extract_name(inst): + assert inst.opname == "STORE_FAST" or inst.opname == "STORE_NAME" + return inst.argval + + +_cache = {} + + +def dims(lists=0): + frame = inspect.currentframe() + assert frame is not None + calling_frame = frame.f_back + assert calling_frame is not None + code, lasti = calling_frame.f_code, calling_frame.f_lasti + key = (code, lasti) + if key not in _cache: + first = lasti // 2 + 1 + instructions = list(dis.get_instructions(calling_frame.f_code)) + unpack = instructions[first] + + if unpack.opname == "STORE_FAST" or unpack.opname == "STORE_NAME": + # just a single dim, not a list + name = unpack.argval + ctor = Dim if lists == 0 else DimList + _cache[key] = lambda: ctor(name=name) + else: + assert unpack.opname == "UNPACK_SEQUENCE" + ndims = unpack.argval + names = tuple( + extract_name(instructions[first + 1 + i]) for i in range(ndims) + ) + first_list = len(names) - lists + _cache[key] = lambda: tuple( + Dim(n) if i < first_list else DimList(name=n) + for i, n in enumerate(names) + ) + return _cache[key]() + + +def _dim_set(positional, arg): + def convert(a): + if isinstance(a, Dim): + return a + else: + assert isinstance(a, int) + return positional[a] + + if arg is None: + return positional + elif not isinstance(arg, (Dim, int)): + return tuple(convert(a) for a in arg) + else: + return (convert(arg),) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/magic_trace.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/magic_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..5c962a898ca79cfe3d8af7432aacc3802d4f4ade --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/magic_trace.py @@ -0,0 +1,42 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import os +import signal +import subprocess +from contextlib import contextmanager + + +@contextmanager +def magic_trace(output="trace.fxt", magic_trace_cache="/tmp/magic-trace"): + pid = os.getpid() + if not os.path.exists(magic_trace_cache): + print(f"Downloading magic_trace to: {magic_trace_cache}") + subprocess.run( + [ + "wget", + "-O", + magic_trace_cache, + "-q", + "https://github.com/janestreet/magic-trace/releases/download/v1.0.2/magic-trace", + ] + ) + subprocess.run(["chmod", "+x", magic_trace_cache]) + args = [magic_trace_cache, "attach", "-pid", str(pid), "-o", output] + p = subprocess.Popen(args, stderr=subprocess.PIPE, encoding="utf-8") + while True: + x = p.stderr.readline() + print(x) + if "Attached" in x: + break + try: + yield + finally: + p.send_signal(signal.SIGINT) + r = p.wait() + print(p.stderr.read()) + p.stderr.close() + if r != 0: + raise ValueError(f"magic_trace exited abnormally: {r}") diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/op_properties.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/op_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..3760f2cb0ea79c2e4ee802abeb8bc954663553e6 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/op_properties.py @@ -0,0 +1,311 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import torch + +# pointwise operators can go through a faster pathway + +tensor_magic_methods = ["add", ""] +pointwise_magic_methods_with_reverse = ( + "add", + "sub", + "mul", + "floordiv", + "div", + "truediv", + "mod", + "pow", + "lshift", + "rshift", + "and", + "or", + "xor", +) +pointwise_magic_methods = ( + *(x for m in pointwise_magic_methods_with_reverse for x in (m, "r" + m)), + "eq", + "gt", + "le", + "lt", + "ge", + "gt", + "ne", + "neg", + "pos", + "abs", + "invert", + "iadd", + "isub", + "imul", + "ifloordiv", + "idiv", + "itruediv", + "imod", + "ipow", + "ilshift", + "irshift", + "iand", + "ior", + "ixor", + "int", + "long", + "float", + "complex", +) + +pointwise_methods = (*(f"__{m}__" for m in pointwise_magic_methods),) + +pointwise = ( + *(getattr(torch.Tensor, m) for m in pointwise_methods), + torch.nn.functional.dropout, + torch.where, + torch.Tensor.abs, + torch.abs, + torch.Tensor.acos, + torch.acos, + torch.Tensor.acosh, + torch.acosh, + torch.Tensor.add, + torch.add, + torch.Tensor.addcdiv, + torch.addcdiv, + torch.Tensor.addcmul, + torch.addcmul, + torch.Tensor.addr, + torch.addr, + torch.Tensor.angle, + torch.angle, + torch.Tensor.asin, + torch.asin, + torch.Tensor.asinh, + torch.asinh, + torch.Tensor.atan, + torch.atan, + torch.Tensor.atan2, + torch.atan2, + torch.Tensor.atanh, + torch.atanh, + torch.Tensor.bitwise_and, + torch.bitwise_and, + torch.Tensor.bitwise_left_shift, + torch.bitwise_left_shift, + torch.Tensor.bitwise_not, + torch.bitwise_not, + torch.Tensor.bitwise_or, + torch.bitwise_or, + torch.Tensor.bitwise_right_shift, + torch.bitwise_right_shift, + torch.Tensor.bitwise_xor, + torch.bitwise_xor, + torch.Tensor.ceil, + torch.ceil, + torch.celu, + torch.nn.functional.celu, + torch.Tensor.clamp, + torch.clamp, + torch.Tensor.clamp_max, + torch.clamp_max, + torch.Tensor.clamp_min, + torch.clamp_min, + torch.Tensor.copysign, + torch.copysign, + torch.Tensor.cos, + torch.cos, + torch.Tensor.cosh, + torch.cosh, + torch.Tensor.deg2rad, + torch.deg2rad, + torch.Tensor.digamma, + torch.digamma, + torch.Tensor.div, + torch.div, + torch.dropout, + torch.nn.functional.dropout, + torch.nn.functional.elu, + torch.Tensor.eq, + torch.eq, + torch.Tensor.erf, + torch.erf, + torch.Tensor.erfc, + torch.erfc, + torch.Tensor.erfinv, + torch.erfinv, + torch.Tensor.exp, + torch.exp, + torch.Tensor.exp2, + torch.exp2, + torch.Tensor.expm1, + torch.expm1, + torch.feature_dropout, + torch.Tensor.float_power, + torch.float_power, + torch.Tensor.floor, + torch.floor, + torch.Tensor.floor_divide, + torch.floor_divide, + torch.Tensor.fmod, + torch.fmod, + torch.Tensor.frac, + torch.frac, + torch.Tensor.frexp, + torch.frexp, + torch.Tensor.gcd, + torch.gcd, + torch.Tensor.ge, + torch.ge, + torch.nn.functional.gelu, + torch.nn.functional.glu, + torch.Tensor.gt, + torch.gt, + torch.Tensor.hardshrink, + torch.hardshrink, + torch.nn.functional.hardshrink, + torch.nn.functional.hardsigmoid, + torch.nn.functional.hardswish, + torch.nn.functional.hardtanh, + torch.Tensor.heaviside, + torch.heaviside, + torch.Tensor.hypot, + torch.hypot, + torch.Tensor.i0, + torch.i0, + torch.Tensor.igamma, + torch.igamma, + torch.Tensor.igammac, + torch.igammac, + torch.Tensor.isclose, + torch.isclose, + torch.Tensor.isfinite, + torch.isfinite, + torch.Tensor.isinf, + torch.isinf, + torch.Tensor.isnan, + torch.isnan, + torch.Tensor.isneginf, + torch.isneginf, + torch.Tensor.isposinf, + torch.isposinf, + torch.Tensor.isreal, + torch.isreal, + torch.Tensor.kron, + torch.kron, + torch.Tensor.lcm, + torch.lcm, + torch.Tensor.ldexp, + torch.ldexp, + torch.Tensor.le, + torch.le, + torch.nn.functional.leaky_relu, + torch.Tensor.lerp, + torch.lerp, + torch.Tensor.lgamma, + torch.lgamma, + torch.Tensor.log, + torch.log, + torch.Tensor.log10, + torch.log10, + torch.Tensor.log1p, + torch.log1p, + torch.Tensor.log2, + torch.log2, + torch.nn.functional.logsigmoid, + torch.Tensor.logical_and, + torch.logical_and, + torch.Tensor.logical_not, + torch.logical_not, + torch.Tensor.logical_or, + torch.logical_or, + torch.Tensor.logical_xor, + torch.logical_xor, + torch.Tensor.logit, + torch.logit, + torch.Tensor.lt, + torch.lt, + torch.Tensor.maximum, + torch.maximum, + torch.Tensor.minimum, + torch.minimum, + torch.nn.functional.mish, + torch.Tensor.mvlgamma, + torch.mvlgamma, + torch.Tensor.nan_to_num, + torch.nan_to_num, + torch.Tensor.ne, + torch.ne, + torch.Tensor.neg, + torch.neg, + torch.Tensor.nextafter, + torch.nextafter, + torch.Tensor.outer, + torch.outer, + torch.polar, + torch.Tensor.polygamma, + torch.polygamma, + torch.Tensor.positive, + torch.positive, + torch.Tensor.pow, + torch.pow, + torch.Tensor.prelu, + torch.prelu, + torch.nn.functional.prelu, + torch.Tensor.rad2deg, + torch.rad2deg, + torch.Tensor.reciprocal, + torch.reciprocal, + torch.Tensor.relu, + torch.relu, + torch.nn.functional.relu, + torch.nn.functional.relu6, + torch.Tensor.remainder, + torch.remainder, + torch.Tensor.round, + torch.round, + torch.rrelu, + torch.nn.functional.rrelu, + torch.Tensor.rsqrt, + torch.rsqrt, + torch.rsub, + torch.selu, + torch.nn.functional.selu, + torch.Tensor.sgn, + torch.sgn, + torch.Tensor.sigmoid, + torch.sigmoid, + torch.nn.functional.sigmoid, + torch.Tensor.sign, + torch.sign, + torch.Tensor.signbit, + torch.signbit, + torch.nn.functional.silu, + torch.Tensor.sin, + torch.sin, + torch.Tensor.sinc, + torch.sinc, + torch.Tensor.sinh, + torch.sinh, + torch.nn.functional.softplus, + torch.nn.functional.softshrink, + torch.Tensor.sqrt, + torch.sqrt, + torch.Tensor.square, + torch.square, + torch.Tensor.sub, + torch.sub, + torch.Tensor.tan, + torch.tan, + torch.Tensor.tanh, + torch.tanh, + torch.nn.functional.tanh, + torch.threshold, + torch.nn.functional.threshold, + torch.trapz, + torch.Tensor.true_divide, + torch.true_divide, + torch.Tensor.trunc, + torch.trunc, + torch.Tensor.xlogy, + torch.xlogy, + torch.rand_like, +) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/reference.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/reference.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5f9f50901929509ce1d378826193b93c79fc32 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/reference.py @@ -0,0 +1,645 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +# reference python implementations for C ops +import torch + +from functorch._C import dim as _C +from . import op_properties +from .batch_tensor import _enable_layers +from .tree_map import tree_flatten, tree_map + +DimList = _C.DimList +import operator +from functools import reduce + + +# use dict to avoid writing C++ bindings for set +pointwise = set(op_properties.pointwise) + + +def prod(x): + return reduce(operator.mul, x, 1) + + +def _wrap_dim(d, N, keepdim): + from . import Dim + + if isinstance(d, Dim): + assert not keepdim, "cannot preserve first-class dimensions with keepdim=True" + return d + elif d >= 0: + return d - N + else: + return d + + +def _dims(d, N, keepdim, single_dim): + from . import Dim + + if isinstance(d, (Dim, int)): + return ltuple((_wrap_dim(d, N, keepdim),)) + assert not single_dim, f"expected a single dimension or int but found: {d}" + return ltuple(_wrap_dim(x, N, keepdim) for x in d) + + +def _bind_dims_to_size(lhs_size, rhs, lhs_debug): + from . import DimensionMismatchError + + not_bound = tuple((i, r) for i, r in enumerate(rhs) if not r.is_bound) + if len(not_bound) == 1: + idx, d = not_bound[0] + rhs_so_far = prod(r.size for r in rhs if r.is_bound) + if lhs_size % rhs_so_far != 0: + rhs_s = tuple("?" if not r.is_bound else str(r.size) for r in rhs) + raise DimensionMismatchError( + f"inferred dimension does not evenly fit into larger dimension: {lhs_size} vs {rhs_s}" + ) + new_size = lhs_size // rhs_so_far + d.size = new_size + elif len(not_bound) > 1: + rhs_s = tuple("?" if not r.is_bound else str(r.size) for r in rhs) + raise DimensionMismatchError( + f"cannot infer the size of two dimensions at once: {rhs} with sizes {rhs_s}" + ) + else: + rhs_size = prod(r.size for r in rhs) + if lhs_size != rhs_size: + raise DimensionMismatchError( + f"Dimension sizes to do not match ({lhs_size} != {rhs_size}) when matching {lhs_debug} to {rhs}" + ) + + +def _tensor_levels(inp): + from . import _Tensor + + if isinstance(inp, _Tensor): + return inp._tensor, llist(inp._levels), inp._has_device + else: + return inp, llist(range(-inp.ndim, 0)), True + + +def _match_levels(v, from_levels, to_levels): + view = [] + permute = [] + requires_view = False + size = v.size() + for t in to_levels: + try: + idx = from_levels.index(t) + permute.append(idx) + view.append(size[idx]) + except ValueError: + view.append(1) + requires_view = True + if permute != list(range(len(permute))): + v = v.permute(*permute) + if requires_view: + v = v.view(*view) + return v + + +# make a single dimension positional but do not permute it, +# used to do multi-tensor operators where the dim being acted on +# should not physically move if possible +def _positional_no_permute(self, dim, expand_dim=False): + from . import Tensor + + ptensor, levels = self._tensor, llist(self._levels) + try: + idx = levels.index(dim) + except ValueError: + if not expand_dim: + raise + idx = 0 + ptensor = ptensor.expand(dim.size, *ptensor.size()) + levels.insert(0, 0) + idx_batched = 0 + for i in range(idx): + if isinstance(levels[i], int): + levels[i] -= 1 + idx_batched += 1 + levels[idx] = -idx_batched - 1 + return Tensor.from_positional(ptensor, levels, self._has_device), idx_batched + + +def seq(a, b): + from . import Dim + + if isinstance(a, Dim) != isinstance(b, Dim): + return False + if isinstance(a, Dim): + return a is b + else: + return a == b + + +class isin: + def __contains__(self, item): + for x in self: + if seq(item, x): + return True + return False + + def index(self, item): + for i, x in enumerate(self): + if seq(item, x): + return i + raise ValueError + + +class llist(isin, list): + pass + + +class ltuple(isin, tuple): + pass + + +empty_dict = {} + + +@classmethod +def __torch_function__(self, orig, cls, args, kwargs=empty_dict): + from . import _Tensor, Tensor, TensorLike + from .delayed_mul_tensor import DelayedMulTensor + + if orig is torch.Tensor.__mul__: + lhs, rhs = args + if ( + isinstance(lhs, _Tensor) + and isinstance(rhs, _Tensor) + and lhs.ndim == 0 + and rhs.ndim == 0 + ): + return DelayedMulTensor(lhs, rhs) + all_dims = llist() + flat_args, unflatten = tree_flatten((args, kwargs)) + device_holding_tensor = None + for f in flat_args: + if isinstance(f, _Tensor): + if f._has_device: + device_holding_tensor = f._batchtensor + for d in f.dims: + if d not in all_dims: + all_dims.append(d) + + def unwrap(t): + if isinstance(t, _Tensor): + r = t._batchtensor + if device_holding_tensor is not None and not t._has_device: + r = r.to(device=device_holding_tensor.device) + return r + return t + + if orig in pointwise: + result_levels = llist() + arg_levels = llist() + to_expand = [] + for i, f in enumerate(flat_args): + if isinstance(f, TensorLike): + ptensor, levels, _ = _tensor_levels(f) + if ( + isinstance(f, _Tensor) + and not f._has_device + and device_holding_tensor is not None + ): + ptensor = ptensor.to(device=device_holding_tensor.device) + flat_args[i] = ptensor + for l in levels: + if l not in result_levels: + result_levels.append(l) + to_expand.append((i, levels)) + + for i, levels in to_expand: + flat_args[i] = _match_levels(flat_args[i], levels, result_levels) + args, kwargs = unflatten(flat_args) + result = orig(*args, **kwargs) + + def wrap(t): + if isinstance(t, TensorLike): + return Tensor.from_positional( + t, result_levels, device_holding_tensor is not None + ) + return t + + return tree_map(wrap, result) + else: + + def wrap(t): + if isinstance(t, TensorLike): + return Tensor.from_batched(t, device_holding_tensor is not None) + return t + + with _enable_layers(all_dims): + print(f"batch_tensor for {orig}") + args, kwargs = unflatten(unwrap(f) for f in flat_args) + result = orig(*args, **kwargs) + # print("END", orig) + return tree_map(wrap, result) + + +def positional(self, *dims): + from . import Dim, DimensionBindError, Tensor + + ptensor, levels = self._tensor, llist(self._levels) + flat_dims = llist() + view = [] + needs_view = False + ndim = self.ndim + for d in dims: + if isinstance(d, DimList): + flat_dims.extend(d) + view.extend(e.size for e in d) + elif isinstance(d, Dim): + flat_dims.append(d) + view.append(d.size) + elif isinstance(d, int): + d = _wrap_dim(d, ndim, False) + flat_dims.append(d) + view.append(ptensor.size(d)) + else: + flat_dims.extend(d) + view.append(prod(e.size for e in d)) + needs_view = True + + permute = list(range(len(levels))) + nflat = len(flat_dims) + for i, d in enumerate(flat_dims): + try: + idx = levels.index(d) + except ValueError as e: + raise DimensionBindError( + f"tensor of dimensions {self.dims} does not contain dim {d}" + ) from e + p = permute[idx] + del levels[idx] + del permute[idx] + levels.insert(i, 0) + permute.insert(i, p) + ptensor = ptensor.permute(*permute) + seen = 0 + for i in range(len(levels) - 1, -1, -1): + if isinstance(levels[i], int): + seen += 1 + levels[i] = -seen + result = Tensor.from_positional(ptensor, levels, self._has_device) + if needs_view: + result = result.reshape(*view, *result.size()[len(flat_dims) :]) + return result + + +def _contains_dim(input): + from . import Dim + + for i in input: + if isinstance(i, Dim): + return True + + +def expand(self, *sizes): + if not _contains_dim(sizes): + return self.__torch_function__(torch.Tensor.expand, None, (self, *sizes)) + dims = sizes + sizes = [d.size for d in dims] + [-1] * self.ndim + self = self.expand(*sizes) + return self[dims] + + +_not_present = object() + + +def _getarg(name, offset, args, kwargs, default): + if len(args) > offset: + return args[offset] + return kwargs.get(name, default) + + +def _patcharg(name, offset, args, kwargs, value): + if len(args) > offset: + args[offset] = value + else: + kwargs[name] = value + + +def _wrap( + orig, dim_offset=0, keepdim_offset=1, dim_name="dim", single_dim=False, reduce=True +): + from . import Dim, Tensor, TensorLike + + def fn(self, *args, **kwargs): + dim = _getarg(dim_name, dim_offset, args, kwargs, _not_present) + if dim is _not_present or (single_dim and not isinstance(dim, Dim)): + with _enable_layers(self.dims): + print(f"dim fallback batch_tensor for {orig}") + return Tensor.from_batched( + orig(self._batchtensor, *args, **kwargs), self._has_device + ) + keepdim = ( + _getarg("keepdim", keepdim_offset, args, kwargs, False) if reduce else False + ) + t, levels = self._tensor, llist(self._levels) + dims = _dims(dim, self._batchtensor.ndim, keepdim, single_dim) + dim_indices = tuple(levels.index(d) for d in dims) + if reduce and not keepdim: + new_levels = [l for i, l in enumerate(levels) if i not in dim_indices] + else: + new_levels = levels + + if len(dim_indices) == 1: + dim_indices = dim_indices[ + 0 + ] # so that dims that really only take a single argument work... + args = list(args) + _patcharg(dim_name, dim_offset, args, kwargs, dim_indices) + + def wrap(t): + if isinstance(t, TensorLike): + return Tensor.from_positional(t, new_levels, self._has_device) + return t + + with _enable_layers(new_levels): + print(f"dim used batch_tensor for {orig}") + r = orig(t, *args, **kwargs) + return tree_map(wrap, r) + + return fn + + +def _def(name, *args, **kwargs): + from . import _Tensor + + orig = getattr(torch.Tensor, name) + setattr(_Tensor, name, _wrap(orig, *args, **kwargs)) + + +no_slice = slice(None) + +_orig_getitem = torch.Tensor.__getitem__ + + +class dim_tracker: + def __init__(self): + self.dims = llist() + self.count = [] + + def record(self, d): + if d not in self.dims: + self.dims.append(d) + self.count.append(1) + + def __getitem__(self, d): + return self.count[self.dims.index(d)] + + +def t__getitem__(self, input): + from . import _Tensor, Dim, DimensionBindError, DimList, Tensor, TensorLike + + # * bail to original example if we have a single non-Dim tensor, or a non-tensor + # * locate ... or an unbound tensor list, and determine its size, bind dim list + # (remember that None does not count to the total dim count) + # * bind simple dims and dim-packs to their sizes, count the number of uses of each dim, + # produce the re-view if needed + # * for each single-use dim index, replace with no_slice and mark that it will be added + # (keep track of whether we have to call super) + # * call super if needed + # * if we have dims to bind, bind them (it will help if we eliminated ... and None before) + + # this handles bool indexing handling, as well as some other simple cases. + + is_simple = ( + not isinstance(input, Dim) + and not isinstance(input, (tuple, list)) + and + # WAR for functorch bug where zero time tensors in getitem are not handled correctly. + not (isinstance(input, TensorLike) and input.ndim == 0) + ) + + if is_simple: + if isinstance(self, _Tensor): + return _Tensor.__torch_function__(_orig_getitem, None, (self, input)) + else: + return _orig_getitem(self, input) + + # can further optimize this case + if not isinstance(input, tuple): + input = [input] + else: + input = list(input) + + dims_indexed = 0 + expanding_object = None + dimlists = [] + for i, s in enumerate(input): + if s is ... or isinstance(s, DimList) and not s.is_bound: + if expanding_object is not None: + msg = ( + "at most one ... or unbound dimension list can exist in indexing list but" + f" found 2 at offsets {i} and {expanding_object}" + ) + raise DimensionBindError(msg) + expanding_object = i + + if isinstance(s, DimList): + dims_indexed += len(s) if s.is_bound else 0 + dimlists.append(i) + elif s is not None and s is not ...: + dims_indexed += 1 + + ndim = self.ndim + if dims_indexed > ndim: + raise IndexError( + f"at least {dims_indexed} indices were supplied but the tensor only has {ndim} dimensions." + ) + if expanding_object is not None: + expanding_ndims = ndim - dims_indexed + obj = input[expanding_object] + if obj is ...: + input[expanding_object : expanding_object + 1] = [ + no_slice + ] * expanding_ndims + else: + obj.bind_len(expanding_ndims) + # flatten the dimslists into the indexing + for i in reversed(dimlists): + input[i : i + 1] = input[i] + dims_indexed = 0 + requires_view = False + size = self.size() + view_sizes = [] + dims_seen = dim_tracker() + + def add_dims(t): + if not isinstance(t, _Tensor): + return + for d in t.dims: + dims_seen.record(d) + + add_dims(self) + dim_packs = [] + for i, idx in enumerate(input): + if idx is None: + input[i] = no_slice + view_sizes.append(1) + requires_view = True + else: + sz = size[dims_indexed] + if isinstance(idx, Dim): + idx.size = sz + dims_seen.record(idx) + view_sizes.append(sz) + elif isinstance(idx, (tuple, list)) and idx and isinstance(idx[0], Dim): + for d in idx: + dims_seen.record(idx) + _bind_dims_to_size(sz, idx, f"offset {i}") + view_sizes.extend(d.size for d in idx) + requires_view = True + dim_packs.append(i) + else: + add_dims(idx) + view_sizes.append(sz) + dims_indexed += 1 + if requires_view: + self = self.view(*view_sizes) + for i in reversed(dim_packs): + input[i : i + 1] = input[i] + + # currenty: + # input is flat, containing either Dim, or Tensor, or something valid for standard indexing + # self may have first-class dims as well. + + # to index: + # drop the first class dims from self, they just become direct indices of their positions + + # figure out the dimensions of the indexing tensors: union of all the dims in the tensors in the index. + # these dimensions will appear and need to be bound at the first place tensor occures + + if isinstance(self, _Tensor): + ptensor_self, levels = self._tensor, list(self._levels) + # indices to ptensor rather than self which has first-class dimensions + input_it = iter(input) + flat_inputs = [next(input_it) if isinstance(l, int) else l for l in levels] + has_device = self._has_device + to_pad = 0 + else: + ptensor_self, flat_inputs = self, input + to_pad = ptensor_self.ndim - len(flat_inputs) + has_device = True + + result_levels = [] + index_levels = [] + tensor_insert_point = None + to_expand = {} + requires_getindex = False + for i, inp in enumerate(flat_inputs): + if isinstance(inp, Dim) and dims_seen[inp] == 1: + flat_inputs[i] = no_slice + result_levels.append(inp) + elif isinstance(inp, TensorLike): + requires_getindex = True + if tensor_insert_point is None: + tensor_insert_point = len(result_levels) + ptensor, levels, _ = _tensor_levels(inp) + to_expand[i] = levels + flat_inputs[i] = ptensor + for l in levels: + if l not in index_levels: + index_levels.append(l) + else: + requires_getindex = True + result_levels.append(0) + + if tensor_insert_point is not None: + result_levels[tensor_insert_point:tensor_insert_point] = index_levels + + for i, levels in to_expand.items(): + flat_inputs[i] = _match_levels(flat_inputs[i], levels, index_levels) + + if requires_getindex: + result = _orig_getitem(ptensor_self, flat_inputs) + else: + result = ptensor_self + + next_positional = -1 + if to_pad > 0: + result_levels.extend([0] * to_pad) + for i, r in enumerate(reversed(result_levels)): + if isinstance(r, int): + result_levels[-1 - i] = next_positional + next_positional -= 1 + + return Tensor.from_positional(result, result_levels, has_device) + + +# XXX - dim is optional and can be the outer-most dimension... +def stack(tensors, new_dim, dim=0, out=None): + if isinstance(dim, int): + return torch.stack(tensors, dim, out).index(dim, new_dim) + index = None + if out is not None: + out, index = _positional_no_permute(out, dim, expand_dim=True) + ptensors = [] + for t in tensors: + pt, pi = _positional_no_permute(t, dim, expand_dim=True) + if index is not None and pi != index: + pt = pt.move_dim(pi, index) + else: + index = pi + ptensors.append(pt) + pr = torch.stack(ptensors, index, out=out) + return pr.index((index, index + 1), (new_dim, dim)) + + +_orig_split = torch.Tensor.split + + +def split(self, split_size_or_sections, dim=0): + from . import _Tensor, Dim + + if isinstance(split_size_or_sections, int) or any( + isinstance(t, int) for t in split_size_or_sections + ): + if isinstance(dim, Dim): + raise ValueError( + "when dim is specified as a Dim object, split sizes must also be dimensions." + ) + return _orig_split(self, split_size_or_sections, dim=dim) + + if isinstance(dim, Dim): + assert isinstance(self, _Tensor), f"Tensor does not have dimension {dim}" + self, dim = _positional_no_permute(self, dim) + + size = self.size(dim) + total_bound_size = 0 + unbound = [] + sizes = [] + for i, d in enumerate(split_size_or_sections): + if d.is_bound: + sizes.append(d.size) + total_bound_size += d.size + else: + sizes.append(0) + unbound.append(i) + + if unbound: + assert ( + total_bound_size <= size + ), f"result dimensions are larger than original: {total_bound_size} vs {size} ({split_size_or_sections})" + remaining_size = size - total_bound_size + chunk_size = -(-remaining_size // len(unbound)) + for u in unbound: + sz = min(chunk_size, remaining_size) + split_size_or_sections[u].size = sz + sizes[u] = sz + remaining_size -= sz + else: + assert ( + total_bound_size == size + ), f"result dimensions do not match original: {total_bound_size} vs {size} ({split_size_or_sections})" + return tuple( + t.index(dim, d) + for d, t in zip(split_size_or_sections, _orig_split(self, sizes, dim=dim)) + ) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/tree_map.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/tree_map.py new file mode 100644 index 0000000000000000000000000000000000000000..1f02f02656f288f81b81bee61736567b2326500d --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/tree_map.py @@ -0,0 +1,14 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +from functorch._C import dim + +tree_flatten = dim.tree_flatten + + +def tree_map(fn, tree): + vs, unflatten = tree_flatten(tree) + return unflatten(fn(v) for v in vs) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/dim/wrap_type.py b/llmeval-env/lib/python3.10/site-packages/functorch/dim/wrap_type.py new file mode 100644 index 0000000000000000000000000000000000000000..e2146c4a21a144dc3942e304d1406ace47df0e57 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/dim/wrap_type.py @@ -0,0 +1,71 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +from types import ( + BuiltinMethodType, + FunctionType, + GetSetDescriptorType, + MethodDescriptorType, + WrapperDescriptorType, +) + +from functorch._C import dim as _C + +_wrap_method = _C._wrap_method + +FUNC_TYPES = ( + FunctionType, + MethodDescriptorType, + BuiltinMethodType, + WrapperDescriptorType, +) +PROPERTY_TYPES = (GetSetDescriptorType, property) + + +def _py_wrap_method(orig, __torch_function__): + def impl(*args, **kwargs): + return __torch_function__(orig, None, args, kwargs) + + return impl + + +def wrap_type(use_c, to_patch, pattern, __torch_function__): + if use_c: + wrap_method = _wrap_method + else: + wrap_method = _py_wrap_method + + all = {} + for t in reversed(pattern.mro()[:-1]): # skip object + all.update(t.__dict__) + + def wrap_attr(orig): + return property(wrap_method(orig.__get__, __torch_function__)) + + for name, obj in all.items(): + if name in ( + "__dict__", + "__new__", + "__init__", + "__repr__", + "__weakref__", + "__doc__", + "__module__", + "__dir__", + ): + continue + + # skip things that have been overloaded + # things that come from object like `__eq__` still need to be patched, however. + if hasattr(to_patch, name) and getattr(to_patch, name) is not getattr( + object, name, None + ): + continue + + if isinstance(obj, FUNC_TYPES): + setattr(to_patch, name, wrap_method(obj, __torch_function__)) + elif isinstance(obj, PROPERTY_TYPES): + setattr(to_patch, name, wrap_attr(obj)) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b32751d6e2493ab6a81f5a7f91a572553201f466 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__init__.py @@ -0,0 +1,3 @@ +from .rearrange import rearrange + +__all__ = ["rearrange"] diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..006279f7134981717c971023fdaa1ea0ef8b78f6 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/_parsing.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/_parsing.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..115e019917cc601c1470674d5014dfc0c0ba4f18 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/_parsing.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/rearrange.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/rearrange.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b402affef542231ab383135df1cffd3b2a002728 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/einops/__pycache__/rearrange.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/_parsing.py b/llmeval-env/lib/python3.10/site-packages/functorch/einops/_parsing.py new file mode 100644 index 0000000000000000000000000000000000000000..63adcb6e5a64c777a4e1a711da5ac9f3b7fe1dfd --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/einops/_parsing.py @@ -0,0 +1,302 @@ +"""Adapted from https://github.com/arogozhnikov/einops/blob/36c7bb16e57d6e57f8f3050f9e07abdf3f00469f/einops/parsing.py. + +MIT License + +Copyright (c) 2018 Alex Rogozhnikov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" +from __future__ import annotations + +import keyword +import warnings +from typing import Collection, List, Mapping, Optional, Set, Tuple, Union + +_ellipsis: str = "…" # NB, this is a single unicode symbol. String is used as it is not a list, but can be iterated + + +class AnonymousAxis: + """Used by `ParsedExpression` to represent an axis with a size (> 1), but no associated identifier. + + Note: Different instances of this class are not equal to each other, even if they have the same value. + """ + + def __init__(self, value: str) -> None: + self.value = int(value) + if self.value < 1: + raise ValueError( + f"Anonymous axis should have positive length, not {self.value}" + ) + + def __repr__(self) -> str: + return f"{self.value}-axis" + + +class ParsedExpression: + """Structure containing information about one side of an `einops`-style pattern (e.g. 'b c (h w)').""" + + def __init__( + self, + expression: str, + *, + allow_underscore: bool = False, + allow_duplicates: bool = False, + ) -> None: + """Parse the expression and store relevant metadata. + + Args: + expression (str): the `einops`-pattern to parse + allow_underscore (bool): whether to allow axis identifier names to begin with an underscore + allow_duplicates (bool): whether to allow an identifier to appear more than once in the expression + """ + self.has_ellipsis: bool = False + self.has_ellipsis_parenthesized: Optional[bool] = None + self.identifiers: Set[Union[str, AnonymousAxis]] = set() + # that's axes like 2, 3, 4 or 5. Axes with size 1 are exceptional and replaced with empty composition + self.has_non_unitary_anonymous_axes: bool = False + # composition keeps structure of composite axes, see how different corner cases are handled in tests + self.composition: List[Union[List[Union[str, AnonymousAxis]], str]] = [] + if "." in expression: + if "..." not in expression: + raise ValueError( + "Expression may contain dots only inside ellipsis (...)" + ) + if str.count(expression, "...") != 1 or str.count(expression, ".") != 3: + raise ValueError( + "Expression may contain dots only inside ellipsis (...); only one ellipsis for tensor " + ) + expression = expression.replace("...", _ellipsis) + self.has_ellipsis = True + + bracket_group: Optional[List[Union[str, AnonymousAxis]]] = None + + def add_axis_name(x: str) -> None: + if x in self.identifiers: + if not (allow_underscore and x == "_") and not allow_duplicates: + raise ValueError( + f"Indexing expression contains duplicate dimension '{x}'" + ) + if x == _ellipsis: + self.identifiers.add(_ellipsis) + if bracket_group is None: + self.composition.append(_ellipsis) + self.has_ellipsis_parenthesized = False + else: + bracket_group.append(_ellipsis) + self.has_ellipsis_parenthesized = True + else: + is_number = str.isdecimal(x) + if is_number and int(x) == 1: + # handling the case of anonymous axis of length 1 + if bracket_group is None: + self.composition.append([]) + else: + pass # no need to think about 1s inside parenthesis + return + is_axis_name, reason = self.check_axis_name_return_reason( + x, allow_underscore=allow_underscore + ) + if not (is_number or is_axis_name): + raise ValueError(f"Invalid axis identifier: {x}\n{reason}") + axis_name: Union[str, AnonymousAxis] = ( + AnonymousAxis(x) if is_number else x + ) + self.identifiers.add(axis_name) + if is_number: + self.has_non_unitary_anonymous_axes = True + if bracket_group is None: + self.composition.append([axis_name]) + else: + bracket_group.append(axis_name) + + current_identifier = None + for char in expression: + if char in "() ": + if current_identifier is not None: + add_axis_name(current_identifier) + current_identifier = None + if char == "(": + if bracket_group is not None: + raise ValueError( + "Axis composition is one-level (brackets inside brackets not allowed)" + ) + bracket_group = [] + elif char == ")": + if bracket_group is None: + raise ValueError("Brackets are not balanced") + self.composition.append(bracket_group) + bracket_group = None + elif str.isalnum(char) or char in ["_", _ellipsis]: + if current_identifier is None: + current_identifier = char + else: + current_identifier += char + else: + raise ValueError(f"Unknown character '{char}'") + + if bracket_group is not None: + raise ValueError(f"Imbalanced parentheses in expression: '{expression}'") + if current_identifier is not None: + add_axis_name(current_identifier) + + @staticmethod + def check_axis_name_return_reason( + name: str, allow_underscore: bool = False + ) -> Tuple[bool, str]: + """Check if the given axis name is valid, and a message explaining why if not. + + Valid axes names are python identifiers except keywords, and should not start or end with an underscore. + + Args: + name (str): the axis name to check + allow_underscore (bool): whether axis names are allowed to start with an underscore + + Returns: + Tuple[bool, str]: whether the axis name is valid, a message explaining why if not + """ + if not str.isidentifier(name): + return False, "not a valid python identifier" + elif name[0] == "_" or name[-1] == "_": + if name == "_" and allow_underscore: + return True, "" + return False, "axis name should should not start or end with underscore" + else: + if keyword.iskeyword(name): + warnings.warn( + f"It is discouraged to use axes names that are keywords: {name}", + RuntimeWarning, + ) + if name in ["axis"]: + warnings.warn( + "It is discouraged to use 'axis' as an axis name and will raise an error in future", + FutureWarning, + ) + return True, "" + + @staticmethod + def check_axis_name(name: str) -> bool: + """Check if the name is a valid axis name. + + Args: + name (str): the axis name to check + + Returns: + bool: whether the axis name is valid + """ + is_valid, _ = ParsedExpression.check_axis_name_return_reason(name) + return is_valid + + +def parse_pattern( + pattern: str, axes_lengths: Mapping[str, int] +) -> Tuple[ParsedExpression, ParsedExpression]: + """Parse an `einops`-style pattern into a left-hand side and right-hand side `ParsedExpression` object. + + Args: + pattern (str): the `einops`-style rearrangement pattern + axes_lengths (Mapping[str, int]): any additional length specifications for dimensions + + Returns: + Tuple[ParsedExpression, ParsedExpression]: a tuple containing the left-hand side and right-hand side expressions + """ + # adapted from einops.einops._prepare_transformation_recipe + # https://github.com/arogozhnikov/einops/blob/230ac1526c1f42c9e1f7373912c7f8047496df11/einops/einops.py + try: + left_str, right_str = pattern.split("->") + except ValueError: + raise ValueError("Pattern must contain a single '->' separator") from None + + if _ellipsis in axes_lengths: + raise ValueError(f"'{_ellipsis}' is not an allowed axis identifier") + + left = ParsedExpression(left_str) + right = ParsedExpression(right_str) + + if not left.has_ellipsis and right.has_ellipsis: + raise ValueError( + f"Ellipsis found in right side, but not left side of a pattern {pattern}" + ) + if left.has_ellipsis and left.has_ellipsis_parenthesized: + raise ValueError( + f"Ellipsis is parenthesis in the left side is not allowed: {pattern}" + ) + + return left, right + + +def validate_rearrange_expressions( + left: ParsedExpression, right: ParsedExpression, axes_lengths: Mapping[str, int] +) -> None: + """Perform expression validations that are specific to the `rearrange` operation. + + Args: + left (ParsedExpression): left-hand side expression + right (ParsedExpression): right-hand side expression + axes_lengths (Mapping[str, int]): any additional length specifications for dimensions + """ + for length in axes_lengths.values(): + if (length_type := type(length)) is not int: + raise TypeError( + f"rearrange axis lengths must be integers, got: {length_type}" + ) + + if left.has_non_unitary_anonymous_axes or right.has_non_unitary_anonymous_axes: + raise ValueError("rearrange only supports unnamed axes of size 1") + + difference = set.symmetric_difference(left.identifiers, right.identifiers) + if len(difference) > 0: + raise ValueError( + f"Identifiers only on one side of rearrange expression (should be on both): {difference}" + ) + + unmatched_axes = axes_lengths.keys() - left.identifiers + if len(unmatched_axes) > 0: + raise ValueError( + f"Identifiers not found in rearrange expression: {unmatched_axes}" + ) + + +def comma_separate(collection: Collection[Union[str, Collection[str]]]) -> str: + """Convert a collection of strings representing first class dims into a comma-separated string. + + Args: + collection (Collection[Union[str, Collection[str]]]): the collection of strings to convert + + Returns: + str: the comma-separated string + + Examples: + >>> comma_separate(('d0',)) + 'd0' + + >>> comma_separate(('d0', 'd1', 'd2', 'd3')) + 'd0, d1, d2, d3' + + >>> comma_separate([('d1', 'd4')]) + '(d1, d4)' + + >>> comma_separate([('d0',), (), ('d1',), ('d2',), ('d3', 'd4')]) + '(d0,), (), (d1,), (d2,), (d3, d4)' + """ + return ", ".join( + item + if isinstance(item, str) + else f"({comma_separate(item)}{',' if len(item) == 1 else ''})" + for item in collection + ) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/einops/rearrange.py b/llmeval-env/lib/python3.10/site-packages/functorch/einops/rearrange.py new file mode 100644 index 0000000000000000000000000000000000000000..0449bb7ed2c72ef68f966f253c99e8570dfbd7ef --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/einops/rearrange.py @@ -0,0 +1,207 @@ +from __future__ import annotations + +import functools +from typing import Callable, Dict, List, Sequence, Tuple, Union + +import torch + +from functorch._C import dim as _C +from ._parsing import ( + _ellipsis, + AnonymousAxis, + comma_separate, + parse_pattern, + validate_rearrange_expressions, +) + +__all__ = ["rearrange"] + +dims = _C.dims + + +@functools.lru_cache(256) +def _create_rearrange_callable( + tensor_ndim: int, pattern: str, **axes_lengths: int +) -> Callable[[torch.Tensor], torch.Tensor]: + r"""Translate an `einops`-style pattern into a callable that performs the rearrange using first-class dimensions. + + Since the an equivalent result is computed for tensors with the same number of dimensions, with the same pattern and + specified axes lengths, this function can be memoized. + + Args: + tensor_ndim (int): the number of dimensions in the tensor to rearrange + pattern (str): the `einops`-style rearrangement pattern + axes_lengths (int): any additional length specifications for dimensions + + Returns: + Callable[[torch.Tensor], torch.Tensor]: a callable that performs the rearrangement + """ + left, right = parse_pattern(pattern, axes_lengths) + validate_rearrange_expressions(left, right, axes_lengths) + + n_anon_dims = sum(not dim for dim in left.composition) + if left.has_ellipsis: + n_ellipsis_dims = tensor_ndim - (len(left.composition) - 1) + n_named_dims = len(left.identifiers) - 1 + + if (pattern_ndim := n_anon_dims + n_named_dims) > tensor_ndim: + raise ValueError( + f"Number of dimensions in pattern ({pattern_ndim}) must be less than or equal to the number of " + f"dimensions in the tensor ({tensor_ndim})" + ) + else: + n_ellipsis_dims = 0 + n_named_dims = len(left.identifiers) + + if (pattern_ndim := len(left.composition)) != tensor_ndim: + raise ValueError( + f"Number of dimensions in pattern ({pattern_ndim}) must be equal to the number of dimensions in " + f"the tensor ({tensor_ndim})" + ) + n_dims = n_named_dims + n_ellipsis_dims + n_anon_dims + + if n_dims == 0: + # an identity rearrangement on a 0-dimension tensor + return lambda tensor: tensor + + first_class_dims: Tuple[str, ...] = tuple(f"d{i}" for i in range(n_dims)) + identifier_dim_map: Dict[Union[str, AnonymousAxis], Tuple[str, ...]] = {} + anon_axes: List[AnonymousAxis] = [] + + # map the left-hand side identifiers to strings representing first class dims + dims_i = 0 + for dimension in left.composition: + if isinstance(dimension, list): + for identifier in dimension: + # non-unitary anon axes are not allowed in rearrange & unitary anon axes are represented as empty lists + assert isinstance(identifier, str) + identifier_dim_map[identifier] = (first_class_dims[dims_i],) + dims_i += 1 + if not dimension: + # unitary anonymous axis + anon_axis = AnonymousAxis("1") + identifier_dim_map[anon_axis] = (first_class_dims[dims_i],) + anon_axes.append(anon_axis) + dimension.append(anon_axis) + dims_i += 1 + elif dimension == _ellipsis: + identifier = _ellipsis + identifier_dim_map[identifier] = tuple( + first_class_dims[dims_i + j] for j in range(n_ellipsis_dims) + ) + dims_i += n_ellipsis_dims + else: + raise ValueError(f"Unexpected dimension: {dimension}") + + def composition_to_dims( + composition: Sequence[Union[List[Union[str, AnonymousAxis]], str]] + ) -> List[Union[str, Tuple[str, ...]]]: + """Convert a `ParsedExpression.composition` into a `Tensor.__getitem__` index of strings representing first + class dims.""" + dim_composition: List[Union[str, Tuple[str, ...]]] = [] + for dimension in composition: + if isinstance(dimension, list): + dim_composition.append( + tuple( + dim + for identifier in dimension + for dim in identifier_dim_map[identifier] + ) + ) + elif dimension == _ellipsis: + dim_composition.extend(identifier_dim_map[_ellipsis]) + else: + raise ValueError(f"Unexpected dimension: {dimension}") + return dim_composition + + left_dims = composition_to_dims(left.composition) + right_dims = composition_to_dims(right.composition) + anon_dims = tuple(identifier_dim_map[axis][0] for axis in anon_axes) + specified_lengths = tuple( + (identifier_dim_map[axis][0], length) for axis, length in axes_lengths.items() + ) + + custom_rearrange_callable_name = "do_rearrange" + custom_rearrange_callable_code = ( + ( + f"def {custom_rearrange_callable_name}(tensor):\n" + f" {comma_separate(first_class_dims)} = dims({n_dims})\n" + ) + + ( + "".join( + f" {dim}.size = {length}\n" for (dim, length) in specified_lengths + ) + if specified_lengths + else "" + ) + + f" tensor = tensor[{comma_separate(left_dims)}].order({comma_separate(right_dims)})\n" + + ( + f" return tensor.sum({comma_separate([anon_dims])}, keepdim=False)\n" + if anon_dims + else " return tensor\n" + ) + ) + + exec(custom_rearrange_callable_code) + return locals()[custom_rearrange_callable_name] + + +def rearrange( + tensor: Union[torch.Tensor, List[torch.Tensor], Tuple[torch.Tensor, ...]], + pattern: str, + **axes_lengths: int, +) -> torch.Tensor: + r"""A native implementation of `einops.rearrange`, a reader-friendly smart element reordering for multidimensional + tensors. This operation includes functionality of transpose (axes permutation), reshape (view), squeeze, unsqueeze, + stack, concatenate and other operations. + + See: https://einops.rocks/api/rearrange/ + + Args: + tensor (Tensor or sequence of Tensor): the tensor(s) to rearrange + pattern (str): the rearrangement pattern + axes_lengths (int): any additional length specifications for dimensions + + Returns: + Tensor: the rearranged tensor + + Examples: + >>> # suppose we have a set of 32 images in "h w c" format (height-width-channel) + >>> images = torch.randn((32, 30, 40, 3)) + + >>> # stack along first (batch) axis, output is a single array + >>> rearrange(images, 'b h w c -> b h w c').shape + torch.Size([32, 30, 40, 3]) + + >>> # concatenate images along height (vertical axis), 960 = 32 * 30 + >>> rearrange(images, 'b h w c -> (b h) w c').shape + torch.Size([960, 40, 3]) + + >>> # concatenated images along horizontal axis, 1280 = 32 * 40 + >>> rearrange(images, 'b h w c -> h (b w) c').shape + torch.Size([30, 1280, 3]) + + >>> # reordered axes to "b c h w" format for deep learning + >>> rearrange(images, 'b h w c -> b c h w').shape + torch.Size([32, 3, 30, 40]) + + >>> # flattened each image into a vector, 3600 = 30 * 40 * 3 + >>> rearrange(images, 'b h w c -> b (c h w)').shape + torch.Size([32, 3600]) + + >>> # split each image into 4 smaller (top-left, top-right, bottom-left, bottom-right), 128 = 32 * 2 * 2 + >>> rearrange(images, 'b (h1 h) (w1 w) c -> (b h1 w1) h w c', h1=2, w1=2).shape + torch.Size([128, 15, 20, 3]) + + >>> # space-to-depth operation + >>> rearrange(images, 'b (h h1) (w w1) c -> b h w (c h1 w1)', h1=2, w1=2).shape + torch.Size([32, 15, 20, 12]) + """ + if not isinstance(tensor, torch.Tensor): + tensor = torch.stack(tensor) + + rearrange_callable = _create_rearrange_callable( + tensor.ndim, pattern, **axes_lengths + ) + + return rearrange_callable(tensor) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__init__.py b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..23fc8381cc2358880f935064edd7eeff9766fec6 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__init__.py @@ -0,0 +1,6 @@ +# PyTorch forward-mode is not mature yet +from torch._functorch.apis import chunk_vmap +from torch._functorch.batch_norm_replacement import replace_all_batch_norm_modules_ +from torch._functorch.eager_transforms import hessian, jacfwd, jvp + +from functorch import functionalize diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c0add8614d45353f85ff60ca99dbefa051fecf8 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/control_flow.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/control_flow.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5361dfda48318a77a0d725edf82ddc957b78c658 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/control_flow.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/ops.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/ops.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b25d2b49a7459b640dbd3c8b86b0f57b8610f9b7 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/__pycache__/ops.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/control_flow.py b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/control_flow.py new file mode 100644 index 0000000000000000000000000000000000000000..e24fc6142820013002f6cbc1d6f85e7e132aade8 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/control_flow.py @@ -0,0 +1,8 @@ +from torch import cond # noqa: F401 +from torch._higher_order_ops.cond import UnsupportedAliasMutationException # noqa: F401 + +from torch._higher_order_ops.map import ( # noqa: F401 + _stack_pytree, + _unstack_pytree, + map, +) diff --git a/llmeval-env/lib/python3.10/site-packages/functorch/experimental/ops.py b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/ops.py new file mode 100644 index 0000000000000000000000000000000000000000..7a502ef2b002cd824e7b67d08fccac872b313110 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/functorch/experimental/ops.py @@ -0,0 +1 @@ +from torch._ops import HigherOrderOperator # noqa: F401 diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/INSTALLER b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSE.txt b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..a76d0ed5ad8501d70722dd7e819d528e1190fb41 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSE.txt @@ -0,0 +1,29 @@ +Copyright (c) 2004 Infrae. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. Neither the name of Infrae nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INFRAE OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSES.txt b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSES.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f97c18aa0b162ffcc3e745d80efb9def1c82515 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/LICENSES.txt @@ -0,0 +1,29 @@ +lxml is copyright Infrae and distributed under the BSD license (see +doc/licenses/BSD.txt), with the following exceptions: + +Some code, such a selftest.py, selftest2.py and +src/lxml/_elementpath.py are derived from ElementTree and +cElementTree. See doc/licenses/elementtree.txt for the license text. + +lxml.cssselect and lxml.html are copyright Ian Bicking and distributed +under the BSD license (see doc/licenses/BSD.txt). + +test.py, the test-runner script, is GPL and copyright Shuttleworth +Foundation. See doc/licenses/GPL.txt. It is believed the unchanged +inclusion of test.py to run the unit test suite falls under the +"aggregation" clause of the GPL and thus does not affect the license +of the rest of the package. + +The isoschematron implementation uses several XSL and RelaxNG resources: + * The (XML syntax) RelaxNG schema for schematron, copyright International + Organization for Standardization (see + src/lxml/isoschematron/resources/rng/iso-schematron.rng for the license + text) + * The skeleton iso-schematron-xlt1 pure-xslt schematron implementation + xsl stylesheets, copyright Rick Jelliffe and Academia Sinica Computing + Center, Taiwan (see the xsl files here for the license text: + src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/) + * The xsd/rng schema schematron extraction xsl transformations are unlicensed + and copyright the respective authors as noted (see + src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl and + src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl) diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/METADATA b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..14af69834c6b3cac3671862238ba671a3ce2ed48 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/METADATA @@ -0,0 +1,89 @@ +Metadata-Version: 2.1 +Name: lxml +Version: 5.2.1 +Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API. +Home-page: https://lxml.de/ +Author: lxml dev team +Author-email: lxml-dev@lxml.de +Maintainer: lxml dev team +Maintainer-email: lxml-dev@lxml.de +License: BSD-3-Clause +Project-URL: Source, https://github.com/lxml/lxml +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Cython +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: C +Classifier: Operating System :: OS Independent +Classifier: Topic :: Text Processing :: Markup :: HTML +Classifier: Topic :: Text Processing :: Markup :: XML +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=3.6 +License-File: LICENSE.txt +License-File: LICENSES.txt +Provides-Extra: cssselect +Requires-Dist: cssselect >=0.7 ; extra == 'cssselect' +Provides-Extra: html5 +Requires-Dist: html5lib ; extra == 'html5' +Provides-Extra: html_clean +Requires-Dist: lxml-html-clean ; extra == 'html_clean' +Provides-Extra: htmlsoup +Requires-Dist: BeautifulSoup4 ; extra == 'htmlsoup' +Provides-Extra: source +Requires-Dist: Cython >=3.0.10 ; extra == 'source' + +lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It +provides safe and convenient access to these libraries using the ElementTree +API. + +It extends the ElementTree API significantly to offer support for XPath, +RelaxNG, XML Schema, XSLT, C14N and much more. + +To contact the project, go to the `project home page +`_ or see our bug tracker at +https://launchpad.net/lxml + +In case you want to use the current in-development version of lxml, +you can get it from the github repository at +https://github.com/lxml/lxml . Note that this requires Cython to +build the sources, see the build instructions on the project home +page. To the same end, running ``easy_install lxml==dev`` will +install lxml from +https://github.com/lxml/lxml/tarball/master#egg=lxml-dev if you have +an appropriate version of Cython installed. + + +After an official release of a new stable series, bug fixes may become +available at +https://github.com/lxml/lxml/tree/lxml-5.2 . +Running ``easy_install lxml==5.2bugfix`` will install +the unreleased branch state from +https://github.com/lxml/lxml/tarball/lxml-5.2#egg=lxml-5.2bugfix +as soon as a maintenance branch has been established. Note that this +requires Cython to be installed at an appropriate version for the build. + +5.2.1 (2024-04-02) +================== + +Bugs fixed +---------- + +* LP#2059910: The minimum CPU architecture for the Linux x86 binary wheels was set back to + "core2", but with SSE 4.2 enabled. + +* LP#2059977: ``Element.iterfind("//absolute_path")`` failed with a ``SyntaxError`` + where it should have issued a warning. + +* GH#416: The documentation build was using the non-standard ``which`` command. + Patch by Michał Górny. + + diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/RECORD b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..b63ecf22c7de485df50f23eb3a93412eca2ebea4 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/RECORD @@ -0,0 +1,201 @@ +lxml-5.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +lxml-5.2.1.dist-info/LICENSE.txt,sha256=ae20RcEzWoMS1MCScYR-mVbYTw2fck0SU0DMP612eyo,1488 +lxml-5.2.1.dist-info/LICENSES.txt,sha256=QdSd1AaqDhVIptXyGjDWv2OLPNlutyid00jYPtLkA5I,1514 +lxml-5.2.1.dist-info/METADATA,sha256=gOuJgh--uI1YuhrzK8UoTG-oBMJJB1tljdEWH-Y9_Aw,3444 +lxml-5.2.1.dist-info/RECORD,, +lxml-5.2.1.dist-info/WHEEL,sha256=DRFGfbmk00iwRfDF9fpLQAJbF-b4Wp23htOC54ltOsw,114 +lxml-5.2.1.dist-info/top_level.txt,sha256=NjD988wqaKq512nshNdLt-uDxsjkp4Bh51m6N-dhUrk,5 +lxml/ElementInclude.py,sha256=PSLeZFvCa76WHJulPLxcZXJtCI2-4dK2CtqPRiYOAQg,8560 +lxml/__init__.py,sha256=muWa7ZIKDJW7z7hAmmliO3nRMLRFeGHBjo7qnnf2mIk,574 +lxml/__pycache__/ElementInclude.cpython-310.pyc,, +lxml/__pycache__/__init__.cpython-310.pyc,, +lxml/__pycache__/_elementpath.cpython-310.pyc,, +lxml/__pycache__/builder.cpython-310.pyc,, +lxml/__pycache__/cssselect.cpython-310.pyc,, +lxml/__pycache__/doctestcompare.cpython-310.pyc,, +lxml/__pycache__/pyclasslookup.cpython-310.pyc,, +lxml/__pycache__/sax.cpython-310.pyc,, +lxml/__pycache__/usedoctest.cpython-310.pyc,, +lxml/_elementpath.cpython-310-x86_64-linux-gnu.so,sha256=QQNpkJSHYkyZj1jb70g4bZzZHAJFRc7xxjzQtBV10B4,209088 +lxml/_elementpath.py,sha256=5-PzX8ZIxPIvESKDGVL829sejYkvx991FSQyM-J0LqE,10888 +lxml/apihelpers.pxi,sha256=zipCUecXzy5INij_qdEEqZoLp9LYB3CJQUzIzFVH1Ow,63610 +lxml/builder.cpython-310-x86_64-linux-gnu.so,sha256=g2l9-5NdQVyGLKlvk8VRM-CmOrBPEacGym59vnUozGs,112416 +lxml/builder.py,sha256=XD0DQc_G-D950Ym2NwDqxF2v9frtldxdfmvYhxhpP64,8100 +lxml/classlookup.pxi,sha256=Tax8Vhbm5C6UCjgmRFsYjW0pFHxIuTthH1MOgASDLgc,22435 +lxml/cleanup.pxi,sha256=ZNEpbv7qx_ICPzsxhCaMUHCOfiznOoZ_u3jlYXHAuh4,8454 +lxml/cssselect.py,sha256=_wZdX-B9p5MeIYABmENIYRWEkwXwX-7jO8Dkf-1rUZU,3306 +lxml/debug.pxi,sha256=zhxiMeNnKtkjn_FWboHk1T-Vtcg_vEGV8jfYK0XyXHM,3282 +lxml/docloader.pxi,sha256=bYSZAxxbBEfVzfLXTUWFRfOyUTfV23L7i9hR2dgtSNY,5772 +lxml/doctestcompare.py,sha256=40EDnkwpcvW86qNa86990OXF42xdHaosSZoiBsEjkzU,17731 +lxml/dtd.pxi,sha256=y2i_PVKnlWCe9VGchgM6t8lIljtVfbWSXuWC-rEbzeE,15228 +lxml/etree.cpython-310-x86_64-linux-gnu.so,sha256=zZ00g74Zo8BV9ZvKDxe17KREzm8UHydWXR-e4DG-_6g,5341640 +lxml/etree.h,sha256=NPhL2CztGkHk3YgMx2j7pkimDavjx_8CTmCRrdMxslM,9912 +lxml/etree.pyx,sha256=dHJaEezpj2bZrsiUZgh5ypC79L3FPxMXRiHnGlBkOx8,133885 +lxml/etree_api.h,sha256=XDHi7lgGoIcyoS8hB27di8OAb0RC6ubGs3ETzd3KDSE,17063 +lxml/extensions.pxi,sha256=58O6mBbDeWnkiIsRd9T7mLodylo7typz2dbjpJryAyY,32088 +lxml/html/ElementSoup.py,sha256=s_dLobLMuKn2DhexR-iDXdZrMFg1RjLy1feHsIeZMpw,320 +lxml/html/__init__.py,sha256=ap2X3ZzRaufsJppVEVa7ctw1bYtBfs7FSRBCUIKPyDk,64302 +lxml/html/__pycache__/ElementSoup.cpython-310.pyc,, +lxml/html/__pycache__/__init__.cpython-310.pyc,, +lxml/html/__pycache__/_diffcommand.cpython-310.pyc,, +lxml/html/__pycache__/_html5builder.cpython-310.pyc,, +lxml/html/__pycache__/_setmixin.cpython-310.pyc,, +lxml/html/__pycache__/builder.cpython-310.pyc,, +lxml/html/__pycache__/clean.cpython-310.pyc,, +lxml/html/__pycache__/defs.cpython-310.pyc,, +lxml/html/__pycache__/diff.cpython-310.pyc,, +lxml/html/__pycache__/formfill.cpython-310.pyc,, +lxml/html/__pycache__/html5parser.cpython-310.pyc,, +lxml/html/__pycache__/soupparser.cpython-310.pyc,, +lxml/html/__pycache__/usedoctest.cpython-310.pyc,, +lxml/html/_diffcommand.py,sha256=kz_7EP9PmYWuczlZcGiw74_rG0eTKvQ2lrO0rkiwlYE,2081 +lxml/html/_html5builder.py,sha256=NLaT-Ev-aBgJpeQl-6ZbJChLZK5GV-znDkHOJD5VQC4,3230 +lxml/html/_setmixin.py,sha256=8IFIOLmVz0G-XzsD2tCEkSFWO-dgPBHgvHufC8ni67s,1188 +lxml/html/builder.py,sha256=aRgS-Ea9bli-muGX0iUQGKAe9D93P8BspQ2WPuiWJcU,4492 +lxml/html/clean.py,sha256=FghSJy4jt2RaBy6dgusowkU18hxpZ4XLE5ceCK9qxyA,503 +lxml/html/defs.py,sha256=ZzOp2TmY9f_ein9GIcDPyN8-f5HVptzSj56umimWub4,4236 +lxml/html/diff.cpython-310-x86_64-linux-gnu.so,sha256=K3PSxK2JraOQ4OwSlTCKZJJ-_K_etEyIt5_6nMDhIUI,372864 +lxml/html/diff.py,sha256=n2jMJW8D2OYfG-SKbdmpSjZ3Lwk516WwJfMn6yvQiuM,30393 +lxml/html/formfill.py,sha256=umgk0BbkAI1W6q9musFbL-cDnI_aap2NsLBJqk0UmVI,9681 +lxml/html/html5parser.py,sha256=dnyC4cqHxywjZSzk0mu2L7THTZjxhg4yF4pncjusa_w,8634 +lxml/html/soupparser.py,sha256=xo8VvNeOEb-SChuXLKCRECh8J7HBiJLE9sAbEskoUUQ,10197 +lxml/html/usedoctest.py,sha256=tPlmVz4KK1GRKV5DJLrdVECeqsT9PlDzSqqTodVi5s0,249 +lxml/includes/__init__.pxd,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/__pycache__/__init__.cpython-310.pyc,, +lxml/includes/c14n.pxd,sha256=DBQcOJ0c_YS245ohMb8fmuEC1kFyv1LrNY_8Mf-syZg,1110 +lxml/includes/config.pxd,sha256=H6Mrl8It21hzRI2hzMId9W48QqkYYkoLT4dniLNmdTw,96 +lxml/includes/dtdvalid.pxd,sha256=Nv0OykjYehv2lO-Zj--q6jS3TAC_dvQVPSgPMuse1NM,689 +lxml/includes/etree_defs.h,sha256=wWC0nsE3NCLBABsKjo_UMBtUJr7yPL7-e8OLc-tGI5o,14245 +lxml/includes/etreepublic.pxd,sha256=Bn4d3JkWPqXputXqI-eJ0xmPrwNFPTfDCa7axgjB7FM,10184 +lxml/includes/extlibs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/extlibs/__pycache__/__init__.cpython-310.pyc,, +lxml/includes/extlibs/libcharset.h,sha256=GA0FumrbNI4VDGlzq3lf5CLaCwXgn4unw2l0btGQFwI,1510 +lxml/includes/extlibs/localcharset.h,sha256=Z_AagaQeq0aDE7NPsVOqEf4nO4KcUp46ggo4d0ONIOQ,6338 +lxml/includes/extlibs/zconf.h,sha256=ROVD_0UUx6mgHWSAGcLJqB0RBcv6PHfx-vbNhur6ir0,16464 +lxml/includes/extlibs/zlib.h,sha256=ilV5r3LqT0J_8ApBUPDMs_xcHkN59ybhARM7Grn8YAw,96829 +lxml/includes/htmlparser.pxd,sha256=9uASkP5dU7OE2lCOLT-z2e01qSbFlp4ehgwdostF_qk,2802 +lxml/includes/libexslt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/libexslt/__pycache__/__init__.cpython-310.pyc,, +lxml/includes/libexslt/exslt.h,sha256=eSW5tMJAewSUANLqk7AGEiU8b2BbCNRyauHnez7nKSU,3114 +lxml/includes/libexslt/exsltconfig.h,sha256=I0m5Qut1Equ7peyWaseRI4jtPC5ENlOp4UthyUYI3QM,1172 +lxml/includes/libexslt/exsltexports.h,sha256=1Jm9KTXm2FUUJIZ6V6-Uw55yG0BMULX3_goyxDd2LL8,1077 +lxml/includes/libxml/HTMLparser.h,sha256=ySe0Ebz_SqcymDMfwbuuXrWFjzk36u87-gEel_Nuctg,10008 +lxml/includes/libxml/HTMLtree.h,sha256=xQMeETDtY8XZnkV9rGkI4UgUIp71I4z2O3R_P1AEwc4,3502 +lxml/includes/libxml/SAX.h,sha256=TG2pkIInEA1vLbMfhB02mZhYSoTKxX-m0RaUGmYyzCo,4418 +lxml/includes/libxml/SAX2.h,sha256=5fiNvrQmkgIzgZJk-38P1txfs-jIvAcL-_hDAE2pQFs,4430 +lxml/includes/libxml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/libxml/__pycache__/__init__.cpython-310.pyc,, +lxml/includes/libxml/c14n.h,sha256=vG_CjBvBDaMDVLD8qTQNqT-fj7rmkvD8O8Q7OCv9p3M,3021 +lxml/includes/libxml/catalog.h,sha256=_aTvqPlvW9WSwGr0UsUr50H3xvLK3KjIT7NEaE8L4Ww,4618 +lxml/includes/libxml/chvalid.h,sha256=TZcceNp6Cw0QlYwIqK9GxyYqL5UiAjpQyjt_yrZGTQE,5087 +lxml/includes/libxml/debugXML.h,sha256=W0JxFbxqZKEDwyTffBNeVPyHjFQL4wj3Vr9PCl63YA4,4928 +lxml/includes/libxml/dict.h,sha256=SweaPGMtTTf4je6dNTIoEzcfEvpsAT9_PhR7FC0K-rQ,1770 +lxml/includes/libxml/encoding.h,sha256=10GEJ6jAieaRXNHDqoHy4s5FSDTfPBm-_Y8V5eSQdqU,8109 +lxml/includes/libxml/entities.h,sha256=QDLCNfqDBiza2N4T5nBqecGLcvmCqdPbbXBpoqd1ZgY,4659 +lxml/includes/libxml/globals.h,sha256=GCp5Iy7IOre0MC1FbFTdpidiSeVFT4fA2t0Facbiw0Q,890 +lxml/includes/libxml/hash.h,sha256=NiQ7FIrpb5_fqLbqB_wuakO2hcbEjkjrLMkWsJ4u7z0,6310 +lxml/includes/libxml/list.h,sha256=kwMDctdAgRtCGInjdXuaBAlNDrn5Vc87rdUNjHgUNH4,3140 +lxml/includes/libxml/nanoftp.h,sha256=q-OGmv3ltTTTbB_n6ehpGFJpS6wwME-pNTkxcYhHKvo,4013 +lxml/includes/libxml/nanohttp.h,sha256=jca5Z9jzu_Lb6ey7B90q6gjZHGlO82LUx0OsTulCl8E,1869 +lxml/includes/libxml/parser.h,sha256=payh3SrRC3q1IBC6OT_RSTZK8Wp1KUoEcca43p-2pds,44410 +lxml/includes/libxml/parserInternals.h,sha256=ZVSsuLs_K-Ldj0ryU1OPP8lnIe3yKN4QL_CgfhmeiZM,16604 +lxml/includes/libxml/relaxng.h,sha256=miygBGaAxpxiG16kzGWbah9Pl84TunzqKIQf9GcTkhE,5830 +lxml/includes/libxml/schemasInternals.h,sha256=V8M4In3zf24EX55Yt4dcfxwp7NpHGYViKnLKwtyrPJ4,26233 +lxml/includes/libxml/schematron.h,sha256=8EhPDhvtlMxl9e0C5rSbEruOvzJS5BC_OOFbq9RXZnY,4255 +lxml/includes/libxml/threads.h,sha256=vWXv_Nvf7a1iJVZO22J7nCUZkTwM1plW6lL_v9Wckd0,1730 +lxml/includes/libxml/tree.h,sha256=qVYizJJHQqrFJPmK_ZbdeWGDTwv2m1MzeZ51xfeVong,38353 +lxml/includes/libxml/uri.h,sha256=A7nSyNLbCGWRVvpVbg8bbo-cw3s-Eu0rs45ILWhzfDk,2568 +lxml/includes/libxml/valid.h,sha256=N0iyv98q1qPwS1lzzuF9U5o_ZSXfPNqsbnq2qjofeU4,12834 +lxml/includes/libxml/xinclude.h,sha256=2M5D4Koe4Q4zX1qYaiKmp0Fq5joC5UpY4fcV6FG80Xw,2887 +lxml/includes/libxml/xlink.h,sha256=UwJVQvFAax69tdMkePYiAlfkpzTTGZM7hWMyGzEDdwk,5002 +lxml/includes/libxml/xmlIO.h,sha256=SSvJNj3eA4zw87n4-tTrsZBGqHnw7_Rt_6jJon_stDk,12253 +lxml/includes/libxml/xmlautomata.h,sha256=6V_99Ozmfjy1EywHByHLBrgvBsItuYoV34qifJDdXDc,3787 +lxml/includes/libxml/xmlerror.h,sha256=mPPTbEDEM3UodTTwMMPhMG0zWsEBMA6w2xUOUELWisM,37295 +lxml/includes/libxml/xmlexports.h,sha256=GZ1O2qLq9NHTeUddup2ac90MdoImLuH81HvA59oYFyY,992 +lxml/includes/libxml/xmlmemory.h,sha256=N1C_93dytOuKccDvGWzRoT5yrA9YZS9A57vb34DwtuY,6116 +lxml/includes/libxml/xmlmodule.h,sha256=y8AmygZrR3wf5UEfyhu6Sf6sn7TTO47g0FUfwdtexA8,1138 +lxml/includes/libxml/xmlreader.h,sha256=iSQmsBM7175FC9D0yPzASIrEVzXktaibRMzmYJPJBxE,12114 +lxml/includes/libxml/xmlregexp.h,sha256=AK69btlcPhG_i_6wVB-VABljotbg241WFsL34STKxmg,5149 +lxml/includes/libxml/xmlsave.h,sha256=A6_a6TtPnAT8vLcSW-CU4ntcs8GCc1igRyjz2eVlpv4,2469 +lxml/includes/libxml/xmlschemas.h,sha256=lXHsYTgPFpvSZF8LSFmHlF6EycX1PkzzW7zejosOn34,6902 +lxml/includes/libxml/xmlschemastypes.h,sha256=MYwlGmoKAo3lHRaaKgnCXiLmPT9KRjdxyCJ7TEyZ6jM,4583 +lxml/includes/libxml/xmlstring.h,sha256=d5PpqxP1I1sfmCUHvVJtjoC9h7hLHcAAQ5ok_Rtf50I,5271 +lxml/includes/libxml/xmlunicode.h,sha256=xqhfmchk-GELwmZWZ2Ha0IgosCy9csZswVDnbmvzRjI,8665 +lxml/includes/libxml/xmlversion.h,sha256=Qa_a27aFYEAc2U7xl_whMtgB8BTe36VfBgUxGjIF2XI,9205 +lxml/includes/libxml/xmlwriter.h,sha256=7tXNqXynH7tbeeMrxcbpI_TI_ZSjxmcR43wXxVg9X9o,20625 +lxml/includes/libxml/xpath.h,sha256=v7fb_GTuugqevysPRNLBocL0YleyEGMyH_SaDpescek,16442 +lxml/includes/libxml/xpathInternals.h,sha256=y3F0P7awBk9qhRQmmEgtSDEHoSvbLN_Q2vIifflypSI,18419 +lxml/includes/libxml/xpointer.h,sha256=9MKw7uRowx53od3plREL_szioEudglZS6H2EUetBToQ,3647 +lxml/includes/libxslt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +lxml/includes/libxslt/__pycache__/__init__.cpython-310.pyc,, +lxml/includes/libxslt/attributes.h,sha256=qKwzfGf7r89esLC65s96iYJWRA-s-Ezss2_V6Mmo1hk,957 +lxml/includes/libxslt/documents.h,sha256=kBihgH5pqRvFalhm_fOFHtJTFhTpBcm681yT5dxgwfw,2704 +lxml/includes/libxslt/extensions.h,sha256=W5UMyJqUP_1zt6sXZ0mgc0gAIwDJrZ8gjByhyrWqvd8,6899 +lxml/includes/libxslt/extra.h,sha256=6X3Wu3NdPtrlqz-Koo7dB-rccnnszi6j3zg599gTByg,1640 +lxml/includes/libxslt/functions.h,sha256=fc4CZj-9KeBHzO9-WWU_bNqmaEZAz3n7NNwClIBXk14,1972 +lxml/includes/libxslt/imports.h,sha256=18kIjoGqdFXR63Ce3ZtzxsTiYV3XGKpchYakMUPDuUI,1840 +lxml/includes/libxslt/keys.h,sha256=16v25VEluS7jYhgg6gYFwVxgGMn-1ctnlhhWWT4RcBY,1155 +lxml/includes/libxslt/namespaces.h,sha256=VofSn2Kkn-a5JyRKCmY3jPp7amQy3n09vzy0KUQt4q0,1666 +lxml/includes/libxslt/numbersInternals.h,sha256=Eg5gYZ5p3h0_e5wyI61S-0E6_ArVJzv0yr63j6BU2fc,2019 +lxml/includes/libxslt/pattern.h,sha256=tJ-BPfs9UYgiZMMoQZbhij3g7xVppYq7TrrOu25eR7Q,2110 +lxml/includes/libxslt/preproc.h,sha256=D_LjEdHhsdyBnEAvflnwFgoR4hGUb72kgEhXkkmPRsw,896 +lxml/includes/libxslt/security.h,sha256=fUD1cy_WxFCTvTNAF0WOQIU4p5CNWn1LHFyZJd-Fx5U,2652 +lxml/includes/libxslt/templates.h,sha256=bnt6Jqui6KU5pNUdMNPbQZkZ5d-VTWqC0TMGkOlVoIo,2268 +lxml/includes/libxslt/transform.h,sha256=ICT7meUV0OTAx27WaKVrKj-aUmR9LSpTNaOAJd2UStg,6311 +lxml/includes/libxslt/variables.h,sha256=cQAgPe4QCcK2uKbWg7Iz-9peM9xWGm7m3M6jQm0sjIA,3143 +lxml/includes/libxslt/xslt.h,sha256=wmFx2Q31Pd8Iq2phAQpY9J3QQatb8lWg3gABtqKFgEw,1964 +lxml/includes/libxslt/xsltInternals.h,sha256=VKpvlPx4gUMYYdnaTFgyzcwamcGR0oOUou0iQi8-I9Q,57894 +lxml/includes/libxslt/xsltconfig.h,sha256=W_FQN0zWOn-tbHapROrD5BgHkeykaG1khzrxl4H6eNc,3682 +lxml/includes/libxslt/xsltexports.h,sha256=1-luH-0bCIgBAlKAXhV-dqHBfwOAQNDamiYbxIlTf0k,1124 +lxml/includes/libxslt/xsltlocale.h,sha256=ppxGEmJfZIJgwRQzCM0_77p9WNekEWq1NrdYZrQl4IE,942 +lxml/includes/libxslt/xsltutils.h,sha256=1eguYgR9-jeNOVlBUktHboaq-VLX6JXraO80TfbARKM,9085 +lxml/includes/lxml-version.h,sha256=2fN0JTHAnzy65wnMxsss7l72xTYbVKZiJMDuIOQaai0,71 +lxml/includes/relaxng.pxd,sha256=HzHlQ6mCcf_tj_JZ9NAVJTVAv8ScCkE8Ifq15y3bS0c,2615 +lxml/includes/schematron.pxd,sha256=Hob7xh-K-MKqp7WiG8thMagf5EkQzmgfi4ds0EF91JA,1604 +lxml/includes/tree.pxd,sha256=Z5mHkABQPlnwu81WTTq7R4fz17rJAkamOvXf_Jp-nxg,20391 +lxml/includes/uri.pxd,sha256=3vOXw6AbSPxAM9uo71T1qnfx-wd9ezXLDQtWsb2zX0I,145 +lxml/includes/xinclude.pxd,sha256=CuO_XZNB6E2JK1qXXWn11APrjFQV5kA6SMyb77WZn0A,804 +lxml/includes/xmlerror.pxd,sha256=pNP5juL4hRHdVdXUWzMspbdtgPqJdHLDu4jns3ItvrI,58016 +lxml/includes/xmlparser.pxd,sha256=d79Wmyof6BX_rjBkKYyDXhBBC3O-yCfyhx8PrI0wm5E,11434 +lxml/includes/xmlschema.pxd,sha256=OLZPd2WDJyopiXJJyo-dAyyYHaeSYFiMAI4tqIiv-Ik,1702 +lxml/includes/xpath.pxd,sha256=e8-ZYUbRG7N1mHETAlknJ_QqAteOosrYLRgpH-OsTkg,5603 +lxml/includes/xslt.pxd,sha256=4yl3pOu7pAvsx5Tc-W4IWCoB8wgtSSR62HI1jqu6jko,8241 +lxml/isoschematron/__init__.py,sha256=D9LF5IXdj08t7QXajHFT3LtIW3-DCbXZw1ZjJZlpn-4,13270 +lxml/isoschematron/__pycache__/__init__.cpython-310.pyc,, +lxml/isoschematron/resources/rng/iso-schematron.rng,sha256=VsWxPyi3iViJDDbjJJw0wWkEHkLrz9zoCA8zJLor9N4,18337 +lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl,sha256=ObebsB8Wt-d3uIA_U5NU85TpnQ3PxPX38TdOAqosMac,3172 +lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl,sha256=QweRrIIM-zFcgg98GXA2CaWfIbgVE0XKEeYSfvv67A0,4563 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl,sha256=xSZ_Ekq_I-62ZpiE5AqYYHwFW_qh855zt9V4_s7rbkY,11703 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl,sha256=x42QJ-dxQ1waPzydsCoQnp2Xj15y53nW43O7BuoDRHk,39957 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl,sha256=Tr9BnO6pzjVWwhqJfm10UlvAy95EgfSCz2iMlrVGT6Q,2015 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl,sha256=ue8q_88X4e_jsJizo31GRNBxNhdxkEE9fY20oq0Iqwk,71764 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl,sha256=BBAdsVSi5zAzeGepuN6gS1saQINDqITXKplmmj4dTWg,20382 +lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt,sha256=OGLiFswuLJEW5EPYKOeoauuCJFEtVa6jyzBE1OcJI98,3310 +lxml/iterparse.pxi,sha256=HcHYTLU6cs1R7GOik62rEkTebgsz1fYttk00iKfOtcw,16527 +lxml/lxml.etree.h,sha256=NPhL2CztGkHk3YgMx2j7pkimDavjx_8CTmCRrdMxslM,9912 +lxml/lxml.etree_api.h,sha256=10b-ePscCH-tL0k-Ve4JD109sxsFJQnNcLXet_7U8wc,17068 +lxml/nsclasses.pxi,sha256=5pzNBhBtlqObPdThL9QIGRs1Dxj1qnr0PyXuTCURqTg,9129 +lxml/objectify.cpython-310-x86_64-linux-gnu.so,sha256=yF0ZRQPngWsI5PypQASvFY4-ewc3ugZHowHKy9bpKIY,3057096 +lxml/objectify.pyx,sha256=pvaZmS21G-qlNjPuVaB_dgGgi0alxNALo7gFOV8Ispc,75735 +lxml/objectpath.pxi,sha256=s5TNG2-EbaWWKLFAiX303B95zK_Ui8ausB__3QvFFGw,11450 +lxml/parser.pxi,sha256=9R2rdzq1f8LOaKSAzAnFghB3rAspy4vcMTB6q8u0RSA,81866 +lxml/parsertarget.pxi,sha256=v1PidxRaG5giwXcTDkpBI7PDFmsZuOcK0y9LdkQaY8M,6326 +lxml/proxy.pxi,sha256=TPfavn4-ufhVlr-GKciz2qXCTUFtvGdxO-F-h30yIws,23697 +lxml/public-api.pxi,sha256=XoP6_cJOEoQIItvE1RiYCKYD1ry4AobaOr4XLo0KSE4,6666 +lxml/pyclasslookup.py,sha256=gLD1HM2HtITYYiGzjEOewSwbB7XkVx_NZv_quCt79Oc,92 +lxml/readonlytree.pxi,sha256=ddRYczhHieJ4XUvWvTPW9N9oQ8vuKtv7lC1mtE1qvH8,18976 +lxml/relaxng.pxi,sha256=3OQ-fZMzP-KF5vM6HTozT_9ee3J0DJnpj9RcHC8LoMw,6339 +lxml/sax.cpython-310-x86_64-linux-gnu.so,sha256=LqPdMCg8pC_R5MfcqdSdeoEXy4AQ71SSDLqXCgQFZKU,186008 +lxml/sax.py,sha256=8e9Ef4Cfbwr7AHMGCBBZcotBkOehQtdaCxsVCgWM5_c,9303 +lxml/saxparser.pxi,sha256=9nJEnVFFFx7vueUJ3fSeDjxG4gLgrXsDBWVkD_f8U1Q,33322 +lxml/schematron.pxi,sha256=hFn1p4egpvvz-Tkk2AH7cbVOavTC-A7mzHABHrGh7g4,5908 +lxml/serializer.pxi,sha256=3wqS0zC0Pgh5ev-8Mn3YB6sVeJVH_j7wjpzSEDVTdvM,67951 +lxml/usedoctest.py,sha256=qRgZKQVcAZcl-zN0AIXVJnOsETUXz2nPXkxuzs1lGgk,230 +lxml/xinclude.pxi,sha256=7eBrI_OK47mmrHQ0ixbixRI8pKqQ1nwkMV-OmKUVlD4,2456 +lxml/xmlerror.pxi,sha256=K7YIB21sLWdf_2GxyUymRZ5vDr3O4OJ5vGjrklBGa6o,49854 +lxml/xmlid.pxi,sha256=5zf9oR6bsCtavGiOmilNyHqYwgG_bnrIabSd2SURtm0,6073 +lxml/xmlschema.pxi,sha256=mumNoHni5S3BQPtcmOHRd61KRaVWu4eOie2wQeB0e6E,8490 +lxml/xpath.pxi,sha256=aqW24V817dUxps4Gnc8h7Tm3QVlITKvxU5_9WgJUIFg,19132 +lxml/xslt.pxi,sha256=R2fpAf0P7GA1Dhjg0-fGVUbxCk8bBAshuoAs4ODwqlc,36023 +lxml/xsltext.pxi,sha256=TImDiAPlAezC07P7RY1N9YChA7AuKFH-G53hXdel9yc,11088 diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/WHEEL b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..2e0eb532e5c23bacec2015cfd6899e53a15efa9f --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.43.0) +Root-Is-Purelib: false +Tag: cp310-cp310-manylinux_2_28_x86_64 + diff --git a/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/top_level.txt b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab90481d5d75200bdc779014d93d69ff85bf9742 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/lxml-5.2.1.dist-info/top_level.txt @@ -0,0 +1 @@ +lxml diff --git a/llmeval-env/lib/python3.10/site-packages/networkx/drawing/tests/baseline/test_house_with_colors.png b/llmeval-env/lib/python3.10/site-packages/networkx/drawing/tests/baseline/test_house_with_colors.png new file mode 100644 index 0000000000000000000000000000000000000000..6c9e5bdee713b998b23ceb6782595b29c2870a0d --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/networkx/drawing/tests/baseline/test_house_with_colors.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1508bda48445c23ab882f801f1c0dd0472f97ae414245c3ab1094005fda4455a +size 21918 diff --git a/llmeval-env/lib/python3.10/site-packages/pathvalidate-3.2.0.dist-info/top_level.txt b/llmeval-env/lib/python3.10/site-packages/pathvalidate-3.2.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..7af485495e2b17cae08c465174724a368c6f087a --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pathvalidate-3.2.0.dist-info/top_level.txt @@ -0,0 +1 @@ +pathvalidate diff --git a/llmeval-env/lib/python3.10/site-packages/pyarrow/_feather.cpython-310-x86_64-linux-gnu.so b/llmeval-env/lib/python3.10/site-packages/pyarrow/_feather.cpython-310-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..f367b32e3f5f78b865b49df87477b7b619505e6a Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/pyarrow/_feather.cpython-310-x86_64-linux-gnu.so differ diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/INSTALLER b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/LICENSE b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..268c00e0364506fa384d9b019001de22beee5332 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Tsuyoshi Hombashi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/METADATA b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..e94d542bda0af891f0762350f90ed4361e75d07c --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/METADATA @@ -0,0 +1,929 @@ +Metadata-Version: 2.1 +Name: pytablewriter +Version: 1.2.0 +Summary: pytablewriter is a Python library to write a table in various formats: AsciiDoc / CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV / YAML. +Home-page: https://github.com/thombashi/pytablewriter +Author: Tsuyoshi Hombashi +Author-email: tsuyoshi.hombashi@gmail.com +License: MIT License +Project-URL: Changlog, https://github.com/thombashi/pytablewriter/releases +Project-URL: Documentation, https://pytablewriter.rtfd.io/ +Project-URL: Funding, https://github.com/sponsors/thombashi +Project-URL: Source, https://github.com/thombashi/pytablewriter +Project-URL: Tracker, https://github.com/thombashi/pytablewriter/issues +Keywords: AsciiDoc,table,CSV,Excel,JavaScript,JSON,LaTeX,LTSV,Markdown,MediaWiki,HTML,pandas,reStructuredText,SQLite,TSV,TOML +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Code Generators +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing +Classifier: Topic :: Text Processing :: Markup :: HTML +Classifier: Topic :: Text Processing :: Markup :: LaTeX +Classifier: Topic :: Text Processing :: Markup :: Markdown +Classifier: Topic :: Text Processing :: Markup :: reStructuredText +Classifier: Typing :: Typed +Requires-Python: >=3.7 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: setuptools >=38.3.0 +Requires-Dist: DataProperty <2,>=1.0.1 +Requires-Dist: mbstrdecoder <2,>=1.0.0 +Requires-Dist: pathvalidate <4,>=2.3.0 +Requires-Dist: tabledata <2,>=1.3.1 +Requires-Dist: tcolorpy <1,>=0.0.5 +Requires-Dist: typepy[datetime] <2,>=1.3.2 +Provides-Extra: all +Requires-Dist: xlwt ; extra == 'all' +Requires-Dist: XlsxWriter <4,>=0.9.6 ; extra == 'all' +Requires-Dist: elasticsearch <9,>=8.0.1 ; extra == 'all' +Requires-Dist: pytablereader <2,>=0.31.3 ; extra == 'all' +Requires-Dist: dominate <3,>=2.1.5 ; extra == 'all' +Requires-Dist: loguru <1,>=0.4.1 ; extra == 'all' +Requires-Dist: SimpleSQLite <2,>=1.3.2 ; extra == 'all' +Requires-Dist: pytablewriter-altrow-theme <1,>=0.2.0 ; extra == 'all' +Requires-Dist: pytablewriter-altcol-theme <1,>=0.1.0 ; extra == 'all' +Requires-Dist: toml <1,>=0.9.3 ; extra == 'all' +Requires-Dist: PyYAML <7,>=3.11 ; extra == 'all' +Requires-Dist: simplejson <4,>=3.8.1 ; extra == 'all' +Requires-Dist: pandas <3,>=0.25.3 ; extra == 'all' +Provides-Extra: docs +Requires-Dist: sphinx-rtd-theme >=1.2.2 ; extra == 'docs' +Requires-Dist: Sphinx >=2.4 ; extra == 'docs' +Requires-Dist: xlwt ; extra == 'docs' +Requires-Dist: XlsxWriter <4,>=0.9.6 ; extra == 'docs' +Requires-Dist: elasticsearch <9,>=8.0.1 ; extra == 'docs' +Requires-Dist: pytablereader <2,>=0.31.3 ; extra == 'docs' +Requires-Dist: dominate <3,>=2.1.5 ; extra == 'docs' +Requires-Dist: loguru <1,>=0.4.1 ; extra == 'docs' +Requires-Dist: SimpleSQLite <2,>=1.3.2 ; extra == 'docs' +Requires-Dist: pytablewriter-altrow-theme <1,>=0.2.0 ; extra == 'docs' +Requires-Dist: pytablewriter-altcol-theme <1,>=0.1.0 ; extra == 'docs' +Requires-Dist: toml <1,>=0.9.3 ; extra == 'docs' +Requires-Dist: PyYAML <7,>=3.11 ; extra == 'docs' +Requires-Dist: simplejson <4,>=3.8.1 ; extra == 'docs' +Requires-Dist: pandas <3,>=0.25.3 ; extra == 'docs' +Provides-Extra: es +Requires-Dist: elasticsearch <9,>=8.0.1 ; extra == 'es' +Provides-Extra: es8 +Requires-Dist: elasticsearch <9,>=8.0.1 ; extra == 'es8' +Provides-Extra: excel +Requires-Dist: xlwt ; extra == 'excel' +Requires-Dist: XlsxWriter <4,>=0.9.6 ; extra == 'excel' +Provides-Extra: from +Requires-Dist: pytablereader <2,>=0.31.3 ; extra == 'from' +Provides-Extra: html +Requires-Dist: dominate <3,>=2.1.5 ; extra == 'html' +Provides-Extra: logging +Requires-Dist: loguru <1,>=0.4.1 ; extra == 'logging' +Provides-Extra: pandas +Requires-Dist: pandas <3,>=0.25.3 ; extra == 'pandas' +Provides-Extra: sqlite +Requires-Dist: SimpleSQLite <2,>=1.3.2 ; extra == 'sqlite' +Provides-Extra: test +Requires-Dist: pandas <3,>=0.25.3 ; extra == 'test' +Requires-Dist: XlsxWriter <4,>=0.9.6 ; extra == 'test' +Requires-Dist: beautifulsoup4 >=4.10 ; extra == 'test' +Requires-Dist: toml <1,>=0.9.3 ; extra == 'test' +Requires-Dist: pytablewriter-altcol-theme <1,>=0.1.0 ; extra == 'test' +Requires-Dist: pytest-md-report >=0.4.1 ; extra == 'test' +Requires-Dist: pytablereader <2,>=0.31.3 ; extra == 'test' +Requires-Dist: SimpleSQLite <2,>=1.3.2 ; extra == 'test' +Requires-Dist: dominate <3,>=2.1.5 ; extra == 'test' +Requires-Dist: pytablewriter-altrow-theme <1,>=0.2.0 ; extra == 'test' +Requires-Dist: loguru <1,>=0.4.1 ; extra == 'test' +Requires-Dist: xlwt ; extra == 'test' +Requires-Dist: PyYAML <7,>=3.11 ; extra == 'test' +Requires-Dist: elasticsearch <9,>=8.0.1 ; extra == 'test' +Requires-Dist: tablib >=3.2.0 ; extra == 'test' +Requires-Dist: pytablereader[excel,sqlite] >=0.31.3 ; extra == 'test' +Requires-Dist: simplejson <4,>=3.8.1 ; extra == 'test' +Requires-Dist: sqliteschema >=1.3.0 ; extra == 'test' +Requires-Dist: pytest >=6.0.1 ; extra == 'test' +Provides-Extra: theme +Requires-Dist: pytablewriter-altrow-theme <1,>=0.2.0 ; extra == 'theme' +Requires-Dist: pytablewriter-altcol-theme <1,>=0.1.0 ; extra == 'theme' +Provides-Extra: toml +Requires-Dist: toml <1,>=0.9.3 ; extra == 'toml' +Provides-Extra: yaml +Requires-Dist: PyYAML <7,>=3.11 ; extra == 'yaml' + +.. contents:: **pytablewriter** + :backlinks: top + :depth: 2 + +Summary +========= +`pytablewriter `__ is a Python library to write a table in various formats: AsciiDoc / CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV / YAML. + +.. image:: https://badge.fury.io/py/pytablewriter.svg + :target: https://badge.fury.io/py/pytablewriter + :alt: PyPI package version + +.. image:: https://anaconda.org/conda-forge/pytablewriter/badges/version.svg + :target: https://anaconda.org/conda-forge/pytablewriter + :alt: conda-forge package version + +.. image:: https://img.shields.io/pypi/pyversions/pytablewriter.svg + :target: https://pypi.org/project/pytablewriter/ + :alt: Supported Python versions + +.. image:: https://img.shields.io/pypi/implementation/pytablewriter.svg + :target: https://pypi.org/project/pytablewriter + :alt: Supported Python implementations + +.. image:: https://github.com/thombashi/pytablewriter/actions/workflows/ci.yml/badge.svg + :target: https://github.com/thombashi/pytablewriter/actions/workflows/ci.yml + :alt: CI status of Linux/macOS/Windows + +.. image:: https://coveralls.io/repos/github/thombashi/pytablewriter/badge.svg?branch=master + :target: https://coveralls.io/github/thombashi/pytablewriter?branch=master + :alt: Test coverage + +.. image:: https://github.com/thombashi/pytablewriter/actions/workflows/github-code-scanning/codeql/badge.svg + :target: https://github.com/thombashi/pytablewriter/actions/workflows/github-code-scanning/codeql + :alt: CodeQL + +Features +-------- +- Write a table in various formats: + - Text formats: + - `AsciiDoc `__ + - CSV / Tab-separated values (TSV) / Space-separated values (SSV) + - HTML / CSS + - JSON / `Line-delimited JSON(LDJSON) `__ + - `Labeled Tab-separated Values (LTSV) `__ + - LaTeX: ``tabular``/``array`` environment + - Markdown: CommonMark / `GitHub Flavored Markdown (GFM) `__ / `kramdown `__ + - `MediaWiki `__ + - reStructuredText: `Grid Tables `__/`Simple Tables `__/`CSV Table `__ + - Source code (definition of a variable that represents tabular data) + - JavaScript / `NumPy `__ (`numpy.array `__) / `Pandas `__ (`pandas.DataFrame `__) / Python + - `TOML `__ + - `YAML `__ + - Unicode + - Binary file formats: + - Microsoft Excel :superscript:`TM` (``.xlsx``/``.xls`` file format) + - `pandas.DataFrame `__ pickle file + - `SQLite `__ database + - Application-specific formats: + - `Elasticsearch `__ +- Automatic table cell formatting: + - Alignment + - Padding + - Decimal places of numbers +- Customize table cell styles: + - Text/Background color + - Text alignment + - Font size/weight + - Thousand separator for numbers: e.g. ``1,000``/``1 000`` +- Configure output: + - Write a table to a stream such as a file/standard-output/string-buffer/Jupyter-Notebook + - Get rendered tabular text +- Data sources: + - nested list + - CSV + - `pandas.DataFrame `__ / `pandas.Series `__ + - etc. +- Multibyte character support +- ANSI color support + +Installation +============ + +Installation: pip +------------------------------ +:: + + pip install pytablewriter + +Some of the formats require additional dependency packages, you can install these packages as follows: + +.. csv-table:: Installation of optional dependencies + :header: Installation example, Remark + + ``pip install pytablewriter[es]``, Elasticsearch + ``pip install pytablewriter[excel]``, Excel + ``pip install pytablewriter[html]``, HTML + ``pip install pytablewriter[sqlite]``, SQLite database + ``pip install pytablewriter[toml]``, TOML + ``pip install pytablewriter[theme]``, pytablewriter theme plugins + ``pip install pytablewriter[all]``, Install all of the optional dependencies + +Installation: conda +------------------------------ +:: + + conda install -c conda-forge pytablewriter + +Installation: apt +------------------------------ +:: + + sudo add-apt-repository ppa:thombashi/ppa + sudo apt update + sudo apt install python3-pytablewriter + +Examples +========== +Write tables +-------------- +Write a Markdown table +~~~~~~~~~~~~~~~~~~~~~~~~ +:Sample Code: + .. code-block:: python + + from pytablewriter import MarkdownTableWriter + + def main(): + writer = MarkdownTableWriter( + table_name="example_table", + headers=["int", "float", "str", "bool", "mix", "time"], + value_matrix=[ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ], + ) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # example_table + |int|float|str |bool | mix | time | + |--:|----:|----|-----|-------:|------------------------| + | 0| 0.10|hoge|True | 0|2017-01-01 03:04:05+0900| + | 2|-2.23|foo |False| |2017-12-23 12:34:51+0900| + | 3| 0.00|bar |True |Infinity|2017-03-03 22:44:55+0900| + |-10|-9.90| |False| NaN|2017-01-01 00:00:00+0900| + +:Rendering Result: + .. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter@master/docs/pages/examples/table_format/text/ss/markdown.png + :scale: 80% + :alt: https://github.com/thombashi/pytablewriter/blob/master/docs/pages/examples/table_format/text/ss/markdown.png + + Rendered markdown at GitHub + +Write a Markdown table with margins +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:Sample Code: + .. code-block:: python + + from pytablewriter import MarkdownTableWriter + + def main(): + writer = MarkdownTableWriter( + table_name="write a table with margins", + headers=["int", "float", "str", "bool", "mix", "time"], + value_matrix=[ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ], + margin=1 # add a whitespace for both sides of each cell + ) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # write a table with margins + | int | float | str | bool | mix | time | + | --: | ----: | ---- | ----- | -------: | ------------------------ | + | 0 | 0.10 | hoge | True | 0 | 2017-01-01 03:04:05+0900 | + | 2 | -2.23 | foo | False | | 2017-12-23 12:34:51+0900 | + | 3 | 0.00 | bar | True | Infinity | 2017-03-03 22:44:55+0900 | + | -10 | -9.90 | | False | NaN | 2017-01-01 00:00:00+0900 | + +``margin`` attribute can be available for all of the text format writer classes. + +Write a GitHub Flavored Markdown (GFM) table +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +If you set ``flavor`` keyword argument of ``MarkdownTableWriter`` class to ``"github"`` or ``"gfm"``, the writer will output markdown tables with GitHub flavor. +GFM can apply some additional styles to tables such as ``fg_color`` (text color). + +:Sample Code: + .. code-block:: python + + from pytablewriter import MarkdownTableWriter + from pytablewriter.style import Style + + writer = MarkdownTableWriter( + column_styles=[ + Style(fg_color="red"), + Style(fg_color="green", decoration_line="underline"), + ], + headers=["A", "B"], + value_matrix=[ + ["abc", 1], + ["efg", 2], + ], + margin=1, + flavor="github", + enable_ansi_escape=False, + ) + writer.write_table() + +Rendered results can be found at `here `__ + +Apply styles to GFM table with programmatically +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Applying style filters to GFM allows for more flexible style settings for cells. +See also the `example <#style-filter>`_ + +Write a Markdown table to a stream or a file +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +`Refer an example `__ + +Write a table to an Excel sheet +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:Sample Code: + .. code-block:: python + + from pytablewriter import ExcelXlsxTableWriter + + def main(): + writer = ExcelXlsxTableWriter() + writer.table_name = "example" + writer.headers = ["int", "float", "str", "bool", "mix", "time"] + writer.value_matrix = [ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 12:34:51+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 22:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ] + writer.dump("sample.xlsx") + + if __name__ == "__main__": + main() + +:Output: + .. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter@master/docs/pages/examples/table_format/binary/spreadsheet/ss/excel_single.png + :scale: 100% + :alt: https://github.com/thombashi/pytablewriter/blob/master/docs/pages/examples/table_format/binary/spreadsheet/ss/excel_single.png + + Output excel file (``sample_single.xlsx``) + +Write a Unicode table +~~~~~~~~~~~~~~~~~~~~~~~ +:Sample Code: + .. code-block:: python + + from pytablewriter import UnicodeTableWriter + + def main(): + writer = UnicodeTableWriter( + table_name="example_table", + headers=["int", "float", "str", "bool", "mix", "time"], + value_matrix=[ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ] + ) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + ┌───┬─────┬────┬─────┬────────┬────────────────────────┐ + │int│float│str │bool │ mix │ time │ + ├───┼─────┼────┼─────┼────────┼────────────────────────┤ + │ 0│ 0.10│hoge│True │ 0│2017-01-01 03:04:05+0900│ + ├───┼─────┼────┼─────┼────────┼────────────────────────┤ + │ 2│-2.23│foo │False│ │2017-12-23 12:34:51+0900│ + ├───┼─────┼────┼─────┼────────┼────────────────────────┤ + │ 3│ 0.00│bar │True │Infinity│2017-03-03 22:44:55+0900│ + ├───┼─────┼────┼─────┼────────┼────────────────────────┤ + │-10│-9.90│ │False│ NaN│2017-01-01 00:00:00+0900│ + └───┴─────┴────┴─────┴────────┴────────────────────────┘ + +Write a table with JavaScript format (as a nested list variable definition) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + + + def main(): + writer = ptw.JavaScriptTableWriter( + table_name="js_variable", + headers=["int", "float", "str", "bool", "mix", "time"], + value_matrix=[ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ], + ) + + writer.write_table() + + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: js + + const js_variable = [ + ["int", "float", "str", "bool", "mix", "time"], + [0, 0.1, "hoge", true, 0, "2017-01-01 03:04:05+0900"], + [2, -2.23, "foo", false, null, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", true, Infinity, "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", NaN, "2017-01-01 00:00:00+0900"] + ]; + +Write a Markdown table from ``pandas.DataFrame`` instance +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``from_dataframe`` method of writer classes will set up tabular data from ``pandas.DataFrame``: + +:Sample Code: + .. code-block:: python + + from textwrap import dedent + import pandas as pd + import io + from pytablewriter import MarkdownTableWriter + + def main(): + csv_data = io.StringIO(dedent("""\ + "i","f","c","if","ifc","bool","inf","nan","mix_num","time" + 1,1.10,"aa",1.0,"1",True,Infinity,NaN,1,"2017-01-01 00:00:00+09:00" + 2,2.20,"bbb",2.2,"2.2",False,Infinity,NaN,Infinity,"2017-01-02 03:04:05+09:00" + 3,3.33,"cccc",-3.0,"ccc",True,Infinity,NaN,NaN,"2017-01-01 00:00:00+09:00" + """)) + df = pd.read_csv(csv_data, sep=',') + + writer = MarkdownTableWriter(dataframe=df) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + | i | f | c | if |ifc|bool | inf |nan|mix_num | time | + |--:|---:|----|---:|---|-----|--------|---|-------:|-------------------------| + | 1|1.10|aa | 1.0| 1|True |Infinity|NaN| 1|2017-01-01 00:00:00+09:00| + | 2|2.20|bbb | 2.2|2.2|False|Infinity|NaN|Infinity|2017-01-02 03:04:05+09:00| + | 3|3.33|cccc|-3.0|ccc|True |Infinity|NaN| NaN|2017-01-01 00:00:00+09:00| + + +Adding a column of the DataFrame index if you specify ``add_index_column=True``: + +:Sample Code: + .. code-block:: python + + import pandas as pd + import pytablewriter as ptw + + def main(): + writer = ptw.MarkdownTableWriter(table_name="add_index_column") + writer.from_dataframe( + pd.DataFrame({"A": [1, 2], "B": [10, 11]}, index=["a", "b"]), + add_index_column=True, + ) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # add_index_column + | | A | B | + |---|--:|--:| + |a | 1| 10| + |b | 2| 11| + +Write a Markdown table from space-separated values +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + + + def main(): + writer = ptw.MarkdownTableWriter(table_name="ps") + writer.from_csv( + """ + USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND + root 1 0.0 0.4 77664 8784 ? Ss May11 0:02 /sbin/init + root 2 0.0 0.0 0 0 ? S May11 0:00 [kthreadd] + root 4 0.0 0.0 0 0 ? I< May11 0:00 [kworker/0:0H] + root 6 0.0 0.0 0 0 ? I< May11 0:00 [mm_percpu_wq] + root 7 0.0 0.0 0 0 ? S May11 0:01 [ksoftirqd/0] + """, + delimiter=" ", + ) + writer.write_table() + + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # ps + |USER|PID|%CPU|%MEM| VSZ |RSS |TTY|STAT|START|TIME| COMMAND | + |----|--:|---:|---:|----:|---:|---|----|-----|----|--------------| + |root| 1| 0| 0.4|77664|8784|? |Ss |May11|0:02|/sbin/init | + |root| 2| 0| 0.0| 0| 0|? |S |May11|0:00|[kthreadd] | + |root| 4| 0| 0.0| 0| 0|? |I< |May11|0:00|[kworker/0:0H]| + |root| 6| 0| 0.0| 0| 0|? |I< |May11|0:00|[mm_percpu_wq]| + |root| 7| 0| 0.0| 0| 0|? |S |May11|0:01|[ksoftirqd/0] | + +Get rendered tabular text as str +---------------------------------- +``dumps`` method returns rendered tabular text. +``dumps`` only available for text format writers. + +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + + + def main(): + writer = ptw.MarkdownTableWriter( + headers=["int", "float", "str", "bool", "mix", "time"], + value_matrix=[ + [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"], + [2, "-2.23", "foo", False, None, "2017-12-23 45:01:23+0900"], + [3, 0, "bar", "true", "inf", "2017-03-03 33:44:55+0900"], + [-10, -9.9, "", "FALSE", "nan", "2017-01-01 00:00:00+0900"], + ], + ) + + print(writer.dumps()) + + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + |int|float|str |bool | mix | time | + |--:|----:|----|-----|-------:|------------------------| + | 0| 0.10|hoge|True | 0|2017-01-01 03:04:05+0900| + | 2|-2.23|foo |False| |2017-12-23 45:01:23+0900| + | 3| 0.00|bar |True |Infinity|2017-03-03 33:44:55+0900| + |-10|-9.90| |False| NaN|2017-01-01 00:00:00+0900| + +Configure table styles +------------------------ +Column styles +~~~~~~~~~~~~~~~ +Writers can specify +`Style `__ +for each column by ``column_styles`` attribute of writer classes. + +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + from pytablewriter.style import Style + + + def main(): + writer = ptw.MarkdownTableWriter( + table_name="set style by column_styles", + headers=[ + "auto align", + "left align", + "center align", + "bold", + "italic", + "bold italic ts", + ], + value_matrix=[ + [11, 11, 11, 11, 11, 11], + [1234, 1234, 1234, 1234, 1234, 1234], + ], + column_styles=[ + Style(), + Style(align="left"), + Style(align="center"), + Style(font_weight="bold"), + Style(font_style="italic"), + Style(font_weight="bold", font_style="italic", thousand_separator=","), + ], # specify styles for each column + ) + writer.write_table() + + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # set style by styles + |auto align|left align|center align| bold |italic|bold italic ts| + |---------:|----------|:----------:|-------:|-----:|-------------:| + | 11|11 | 11 | **11**| _11_| _**11**_| + | 1234|1234 | 1234 |**1234**|_1234_| _**1,234**_| + + `Rendering result `__ + + +You can also set ``Style`` to a specific column with an index or header by using ``set_style`` method: + +:Sample Code: + .. code-block:: python + + from pytablewriter import MarkdownTableWriter + from pytablewriter.style import Style + + def main(): + writer = MarkdownTableWriter() + writer.headers = ["A", "B", "C",] + writer.value_matrix = [[11, 11, 11], [1234, 1234, 1234]] + + writer.table_name = "set style by column index" + writer.set_style(1, Style(align="center", font_weight="bold")) + writer.set_style(2, Style(thousand_separator=" ")) + writer.write_table() + writer.write_null_line() + + writer.table_name = "set style by header" + writer.set_style("B", Style(font_style="italic")) + writer.write_table() + + if __name__ == "__main__": + main() + +:Output: + .. code-block:: + + # set style by column index + | A | B | C | + |---:|:------:|----:| + | 11| **11** | 11| + |1234|**1234**|1 234| + + # set style by header + | A | B | C | + |---:|-----:|----:| + | 11| _11_| 11| + |1234|_1234_|1 234| + +Style filter +~~~~~~~~~~~~~~ +You can apply styles to specific cells by using style filters. +Style filters will be written as Python functions. +Examples of a style filter function and how you apply it are as follows: + +:Sample Code: + .. code-block:: python + + from typing import Any, Optional + + from pytablewriter import MarkdownTableWriter + from pytablewriter.style import Cell, Style + + + def style_filter(cell: Cell, **kwargs: Any) -> Optional[Style]: + if cell.is_header_row(): + return None + + if cell.col == 0: + return Style(font_weight="bold") + + value = int(cell.value) + + if value > 80: + return Style(fg_color="red", font_weight="bold", decoration_line="underline") + elif value > 50: + return Style(fg_color="yellow", font_weight="bold") + elif value > 20: + return Style(fg_color="green") + + return Style(fg_color="lightblue") + + + writer = MarkdownTableWriter( + table_name="style filter example", + headers=["Key", "Value 1", "Value 2"], + value_matrix=[ + ["A", 95, 40], + ["B", 55, 5], + ["C", 30, 85], + ["D", 0, 69], + ], + flavor="github", + enable_ansi_escape=False, + ) + writer.add_style_filter(style_filter) + writer.write_table() + +Rendered results can be found at `here `__ + +Theme +~~~~~~~ +Themes consists of a set of style filters. +The following command will install external predefined themes: + +:: + + pip install pytablewriter[theme] + +Themes can be set via the constructor of the writer classes or the ``set_theme`` method. +The following is an example of setting the ``altrow`` theme via the constructor. +``altrow`` theme will be colored rows alternatively: + +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + + writer = ptw.TableWriterFactory.create_from_format_name( + "markdown", + headers=["INT", "STR"], + value_matrix=[[1, "hoge"], [2, "foo"], [3, "bar"]], + margin=1, + theme="altrow", + ) + writer.write_table() + +:Output: + .. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter-altrow-theme@master/ss/ptw-altrow-theme_example_default.png + :scale: 100% + :alt: https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_default.png + +`[theme]` extras includes the following themes: + +- `pytablewriter-altrow-theme `__ + - `Generated HTML table example `__ +- `pytablewriter-altcol-theme `__ + - `Generated HTML table example `__ + +Make tables for specific applications +--------------------------------------- +Render a table on Jupyter Notebook +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +All table writer class instances in ``pytablewriter`` can render in Jupyter Notebook. +To render writers at notebook cells, you will require the dependency packages to be installed either by: + +- ``pip install pytablewriter[html]`` or +- ``pip install pytablewriter[all]`` + +Jupyter Notebook code examples can be found `here `__: + +.. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter@master/ss/jupyter_notebook.png + :scale: 100% + :alt: https://github.com/thombashi/pytablewriter/blob/master/ss/jupyter_notebook.png + + Table rendering results of Jupyter Notebook + +Multibyte character support +----------------------------- +Write a table using multibyte character +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +You can use multibyte characters as table data. +Multibyte characters are also properly padded and aligned. + +:Sample Code: + .. code-block:: python + + import pytablewriter as ptw + + + def main(): + writer = ptw.RstSimpleTableWriter( + table_name="生成に関するパターン", + headers=["パターン名", "概要", "GoF", "Code Complete[1]"], + value_matrix=[ + ["Abstract Factory", "関連する一連のインスタンスを状況に応じて、適切に生成する方法を提供する。", "Yes", "Yes"], + ["Builder", "複合化されたインスタンスの生成過程を隠蔽する。", "Yes", "No"], + ["Factory Method", "実際に生成されるインスタンスに依存しない、インスタンスの生成方法を提供する。", "Yes", "Yes"], + ["Prototype", "同様のインスタンスを生成するために、原型のインスタンスを複製する。", "Yes", "No"], + ["Singleton", "あるクラスについて、インスタンスが単一であることを保証する。", "Yes", "Yes"], + ], + ) + writer.write_table() + + + if __name__ == "__main__": + main() + +:Output: + .. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter@master/docs/pages/examples/multibyte/ss/multi_byte_char.png + :scale: 100% + :alt: https://github.com/thombashi/pytablewriter/blob/master/docs/pages/examples/multibyte/ss/multi_byte_char.png + + Output of multi-byte character table + +Multiprocessing +----------------- +You can increase the number of workers to process table data via ``max_workers`` attribute of a writer. +The more ``max_workers`` the less processing time when tabular data is large and the execution environment has available cores. + +If you increase ``max_workers`` larger than one, recommend using main guarded as follows to avoid problems caused by multi-processing: + +.. code-block:: python + + from multiprocessing import cpu_count + import pytablewriter as ptw + + def main(): + writer = ptw.MarkdownTableWriter() + writer.max_workers = cpu_count() + ... + + if __name__ == "__main__": + main() + +For more information +---------------------- +More examples are available at +https://pytablewriter.rtfd.io/en/latest/pages/examples/index.html + +Dependencies +============ +- Python 3.7+ +- `Python package dependencies (automatically installed) `__ + + +Optional dependencies +--------------------- +- ``logging`` extras + - `loguru `__: Used for logging if the package installed +- ``from`` extras + - `pytablereader `__ +- ``es`` extra + - `elasticsearch `__ +- ``excel`` extras + - `xlwt `__ + - `XlsxWriter `__ +- ``html`` extras + - `dominate `__ +- ``sqlite`` extras + - `SimpleSQLite `__ +- ``theme`` extras + - `pytablewriter-altrow-theme `__ + - `pytablewriter-altcol-theme `__ +- ``toml`` extras + - `toml `__ + +Documentation +=============== +https://pytablewriter.rtfd.io/ + +Projects using pytablewriter +================================== +- `pytest-md-report `__ + + +Related Projects +================================== +- `pytablereader `__ + - Tabular data loaded by ``pytablereader`` can be written another tabular data format with ``pytablewriter``. + +Sponsors +==================================== +.. image:: https://avatars.githubusercontent.com/u/44389260?s=48&u=6da7176e51ae2654bcfd22564772ef8a3bb22318&v=4 + :target: https://github.com/chasbecker + :alt: Charles Becker (chasbecker) +.. image:: https://avatars.githubusercontent.com/u/46711571?s=48&u=57687c0e02d5d6e8eeaf9177f7b7af4c9f275eb5&v=4 + :target: https://github.com/Arturi0 + :alt: onetime: Arturi0 +.. image:: https://avatars.githubusercontent.com/u/3658062?s=48&v=4 + :target: https://github.com/b4tman + :alt: onetime: Dmitry Belyaev (b4tman) + +`Become a sponsor `__ + diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/RECORD b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..fe5ba01796a258832cdfd58e244dea7070f0c515 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/RECORD @@ -0,0 +1,139 @@ +pytablewriter-1.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pytablewriter-1.2.0.dist-info/LICENSE,sha256=qT11vLB3TimQEGOAytrW3LLeGTxV1DX_xWujRaCLHcI,1084 +pytablewriter-1.2.0.dist-info/METADATA,sha256=0Wnu9isWPIZJlWz2FbvlAtx2yycl-4II7DxUMD9yO_o,37921 +pytablewriter-1.2.0.dist-info/RECORD,, +pytablewriter-1.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92 +pytablewriter-1.2.0.dist-info/top_level.txt,sha256=4qovxzrpT62Feu8LLdPGtIqYBswTr4QcU4mRmpM61-k,14 +pytablewriter/__init__.py,sha256=E2Y4TxopUWgqMateYeM22S6pGZct8qa_S78a1J_x9ao,2942 +pytablewriter/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/__pycache__/__version__.cpython-310.pyc,, +pytablewriter/__pycache__/_converter.cpython-310.pyc,, +pytablewriter/__pycache__/_factory.cpython-310.pyc,, +pytablewriter/__pycache__/_function.cpython-310.pyc,, +pytablewriter/__pycache__/_table_format.cpython-310.pyc,, +pytablewriter/__pycache__/_typing.cpython-310.pyc,, +pytablewriter/__pycache__/error.cpython-310.pyc,, +pytablewriter/__version__.py,sha256=jMpcYYHOmAVqxHupt-XeoKSCb2KyHxAKYdLvxCET3VU,201 +pytablewriter/_converter.py,sha256=iPlzCNzbGPJ4eSfgMz7DwD7GjaV0n1zxBm_iIzbvG7E,238 +pytablewriter/_factory.py,sha256=jd12k0fPgy7YwdXjO26T4MK-XxEOLHZylUaUEcX4HH4,10839 +pytablewriter/_function.py,sha256=rBDD1Uka9k7R4adjUf2syCAipN4me7ymNJXpAGoO7kk,2402 +pytablewriter/_logger/__init__.py,sha256=DzORajZGSzcVR5wMlNgQ2b54Pr1CBgaN3OycGTp9s7g,107 +pytablewriter/_logger/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/_logger/__pycache__/_logger.cpython-310.pyc,, +pytablewriter/_logger/__pycache__/_null_logger.cpython-310.pyc,, +pytablewriter/_logger/_logger.py,sha256=-kcFift5s8FXFqB4ajALK7Dpnkyc9aWRGV6JrXZhpgI,3287 +pytablewriter/_logger/_null_logger.py,sha256=QJuaErUIV_x6NjQ9qNX9eNSi_GB_9CrO7lKeXYZnuaw,1088 +pytablewriter/_table_format.py,sha256=CowmtamVcQYT4zmvGbw6vIexTBadtSigoDmw9_FamlM,9446 +pytablewriter/_typing.py,sha256=HRJjzKYxa8rxk0DOurr5LPTs57flr7aQKiKjBtkR4is,109604 +pytablewriter/error.py,sha256=MwPbc4EtUklc7X3eVWADVCA6rrzelfsBcH16E0pJQeE,787 +pytablewriter/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pytablewriter/sanitizer/__init__.py,sha256=Ob9cbVV0DBI6W6fupmMIHEgoSCdaGeyxo_VhfvNizEM,703 +pytablewriter/sanitizer/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_base.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_elasticsearch.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_excel.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_interface.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_javascript.cpython-310.pyc,, +pytablewriter/sanitizer/__pycache__/_python.cpython-310.pyc,, +pytablewriter/sanitizer/_base.py,sha256=njQCXCWzVmvgZuGH5qDKVNqMSAKj6hHBla1S36_g4qo,2898 +pytablewriter/sanitizer/_elasticsearch.py,sha256=yTUCMks3ghGMrClpvE5jEplOi-8tZ0cJx0vObi1eOBM,733 +pytablewriter/sanitizer/_excel.py,sha256=6zWWt6Umtt7kCCO7HPYeEqFQkj5OlkOJqMlJdPiMLFY,2458 +pytablewriter/sanitizer/_interface.py,sha256=mH2SpdHYgvpENEfLmGZhQnfSs-1DD86PhT6g69fI5kE,913 +pytablewriter/sanitizer/_javascript.py,sha256=UO2KzHncysO6pWYGiLstVWDMskVb5apzz2PfLsgzHrQ,3570 +pytablewriter/sanitizer/_python.py,sha256=RYEzmPuCx7D1y5mhjoTzoeHhIaVVVaHpWbvwTFkFyJw,3072 +pytablewriter/style/__init__.py,sha256=OmdQIAKEu8o5E9Xu9fN_kQ1SAtCZZPebFEY8QQjGFpQ,1107 +pytablewriter/style/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/style/__pycache__/_cell.cpython-310.pyc,, +pytablewriter/style/__pycache__/_font.cpython-310.pyc,, +pytablewriter/style/__pycache__/_style.cpython-310.pyc,, +pytablewriter/style/__pycache__/_styler.cpython-310.pyc,, +pytablewriter/style/__pycache__/_styler_interface.cpython-310.pyc,, +pytablewriter/style/__pycache__/_theme.cpython-310.pyc,, +pytablewriter/style/_cell.py,sha256=Ggaq9xm2r_oXUv_W2eV1YLZeI-U0AVsTpAJBfj1Dozw,549 +pytablewriter/style/_font.py,sha256=f3e9bKB83JYu7Yow7EYA_6XCJvqyCSMvjrIXC-Uelfc,341 +pytablewriter/style/_style.py,sha256=VRXE01qJRZk3VAPuIU9q2pxTJupz4qHwPOieD1elsvA,12523 +pytablewriter/style/_styler.py,sha256=yfPSPGCiaKQvrzDZxMp36oChhGS13N6Jv1l9hxzBQSs,9920 +pytablewriter/style/_styler_interface.py,sha256=rM1OX8rYIQsk9vtPmbrrcTlf4e0_So2XrHT3L4z1bF8,828 +pytablewriter/style/_theme.py,sha256=A6t0Q-SkQhrwCTvXUVBE9rt-h-M-2VmNavtsMynzTLY,2948 +pytablewriter/typehint/__init__.py,sha256=FDTB4uiJDm2b0A6IsYtTVO2Z994tb5o3kcXbwkDDKYQ,545 +pytablewriter/typehint/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/writer/__init__.py,sha256=r0ZSklAeSM84jA4xzvTFaXHVe0Il0GjAQ8vk2_mtplQ,1766 +pytablewriter/writer/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_common.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_elasticsearch.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_interface.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_msgfy.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_null.cpython-310.pyc,, +pytablewriter/writer/__pycache__/_table_writer.cpython-310.pyc,, +pytablewriter/writer/_common.py,sha256=BjKw-NvsyNQw9D8Zrpg8RyjLjgQjc0QiLbp1bQoGROE,221 +pytablewriter/writer/_elasticsearch.py,sha256=tgcXdlIp_pX8J117mW99TEvCAP3vaz0TnxJnfo6B9NI,6272 +pytablewriter/writer/_interface.py,sha256=Vg_5HlUcOca-PhyoqDuRxzvyQGcuqie1_f1U_lGZKL0,2647 +pytablewriter/writer/_msgfy.py,sha256=Qf3VIhuCfstgGOEaYQswrW9R1lgYFknjw33YZJGNyFo,1777 +pytablewriter/writer/_null.py,sha256=YPBm1lc23wCQbVHuYKPPOTtdlZKfZOBIEWpkuBKQEw4,1590 +pytablewriter/writer/_table_writer.py,sha256=LHibO5UY8StL0fzcnLuc_FkbSoIv3f6D8CEZMWbD0Yk,41943 +pytablewriter/writer/binary/__init__.py,sha256=akvPmDxtQjvKEac2yx9c-96CURTFx0809iPPskpa25c,281 +pytablewriter/writer/binary/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/writer/binary/__pycache__/_excel.cpython-310.pyc,, +pytablewriter/writer/binary/__pycache__/_excel_workbook.cpython-310.pyc,, +pytablewriter/writer/binary/__pycache__/_interface.cpython-310.pyc,, +pytablewriter/writer/binary/__pycache__/_pandas.cpython-310.pyc,, +pytablewriter/writer/binary/__pycache__/_sqlite.cpython-310.pyc,, +pytablewriter/writer/binary/_excel.py,sha256=66h62U0xbboSDkuMB2qO5xT_tXcqtf-18XCH-yqgjgI,15436 +pytablewriter/writer/binary/_excel_workbook.py,sha256=E6xvw1zvTsYBhih5FeStRu23Q1bSJMgQ093pvxdVllI,3936 +pytablewriter/writer/binary/_interface.py,sha256=U48pCiVMUgeYSKCINncSN5Sy9OnYQ90LMhC7Ls1C8O0,1487 +pytablewriter/writer/binary/_pandas.py,sha256=__TzeKz31To7Kh4v7o8JKwTXfz0kYeNo27e_Bcs38LA,2633 +pytablewriter/writer/binary/_sqlite.py,sha256=ZnXqvidGUri1SM-Cxls1NwgVg9riDaPkFnr9iQjGchQ,2982 +pytablewriter/writer/text/__init__.py,sha256=_rk5sczp6H9sag4PXgKIbxSTrgW8HktmlJqN0cXR01M,1384 +pytablewriter/writer/text/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_asciidoc.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_borderless.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_common.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_css.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_csv.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_html.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_interface.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_json.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_jsonlines.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_latex.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_ltsv.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_markdown.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_mediawiki.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_rst.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_spacealigned.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_text_writer.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_toml.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_tsv.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_unicode.cpython-310.pyc,, +pytablewriter/writer/text/__pycache__/_yaml.cpython-310.pyc,, +pytablewriter/writer/text/_asciidoc.py,sha256=T7PQ2qpN68K0GgeORTUCmCy0uY7iq3xwpCU_7vxSrms,4362 +pytablewriter/writer/text/_borderless.py,sha256=4RhWiSppkS2bRIl8osmqkSst-hwDzaAT-GaSyHyHft4,1010 +pytablewriter/writer/text/_common.py,sha256=1YRanAyjyEgo9muaUM3n9pPieKsX0d5Y-_ktI92B_tA,554 +pytablewriter/writer/text/_css.py,sha256=-271SLbV9wYm2YLqUf64HBrkoL2iBX1wxSUeyzyJOk4,5488 +pytablewriter/writer/text/_csv.py,sha256=zfL8yUspvp98JYyqEi_OtB0Xp7wYp11CXQSVX3lhuiY,1490 +pytablewriter/writer/text/_html.py,sha256=4zn3eXdvKS7s_gJbSlkQhb-dJoQjxf_pq9pms1XHkzw,6327 +pytablewriter/writer/text/_interface.py,sha256=Qcwjq6w_dz5Lk7Txr42ESnomW0316-LqPBo1HmcRP7I,642 +pytablewriter/writer/text/_json.py,sha256=djJKShELQfISL_S2XUNvl67ToFST08tw4E7WyGurvRs,5073 +pytablewriter/writer/text/_jsonlines.py,sha256=5tQqMzsJQumpvIykCxiLNmjWF5PM875ci_TMIKOEjSM,1282 +pytablewriter/writer/text/_latex.py,sha256=GacA95fAjdFtAPrfmsOtfw6UG0yU4rqUWOL2KxZ2XHM,6322 +pytablewriter/writer/text/_ltsv.py,sha256=xsMAMMU2F5UdznagXnQJbz62-nstSiSbjm7vgHlLm_s,1517 +pytablewriter/writer/text/_markdown.py,sha256=r_HATSDEYnAP57hoWoTImoNHFLh99c5IMEVNqwMOnnc,6193 +pytablewriter/writer/text/_mediawiki.py,sha256=dwlBbkKQGgpvt2bZVy12AVjaWKRZyP9Q1Kzomyh1cTg,3271 +pytablewriter/writer/text/_rst.py,sha256=MrJdVHxOvHRAwd0YoUXvLfGtfswKo0IRSS1fjTrVJUw,6912 +pytablewriter/writer/text/_spacealigned.py,sha256=osMTS0cvNl8qWthlUkB6noAaKGlBUL02MW-YEvMXEgA,897 +pytablewriter/writer/text/_text_writer.py,sha256=YTqd-SWS72coC9Y2nfkDqlpu44wDWiS49kBAX2AQ9JM,20542 +pytablewriter/writer/text/_toml.py,sha256=oUQRIiNIXQ47ccGasVohbDGBksMMxDETv0mnbCngVC8,2265 +pytablewriter/writer/text/_tsv.py,sha256=xLXiOznMZ8W8fKa-xfZCNlTl2Q4_HWFTUQlR4__DjuU,467 +pytablewriter/writer/text/_unicode.py,sha256=-2W2O-FaBkPDAJuwBKLEutGS09y7DcasK4Q83K0GXiE,3532 +pytablewriter/writer/text/_yaml.py,sha256=WfvH-hdBsWUt8JerzuBQ1xqJN88fLs-GMfcuJeU2QPs,1980 +pytablewriter/writer/text/sourcecode/__init__.py,sha256=25ju5UpRUV7DBNsusSj4YLzOLY5akmmEW7gKegSVtu4,297 +pytablewriter/writer/text/sourcecode/__pycache__/__init__.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/__pycache__/_javascript.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/__pycache__/_numpy.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/__pycache__/_pandas.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/__pycache__/_python.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/__pycache__/_sourcecode.cpython-310.pyc,, +pytablewriter/writer/text/sourcecode/_javascript.py,sha256=uTMT1sRuUoq-pbvE50Tjoi1j3Q6ywNFO5jK3mJljNxw,4710 +pytablewriter/writer/text/sourcecode/_numpy.py,sha256=RwPtBXuAzbc2AoA530IpJr0enpOUe0gEaUR936yRuNs,1970 +pytablewriter/writer/text/sourcecode/_pandas.py,sha256=I1RuFWVFExE1c3QX3RbdVN57B5oojXqNMwnOF0rXl_A,2556 +pytablewriter/writer/text/sourcecode/_python.py,sha256=O5ii7UOGef_u92cBL673pG_888_wLS-s6TnLDyor7V8,2541 +pytablewriter/writer/text/sourcecode/_sourcecode.py,sha256=EGKbj3qvj83LrnkgNjEUt0uzRYDXPWKJSmaXjhCaWAo,2245 diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/WHEEL b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..7e688737d490be3643d705bc16b5a77f7bd567b7 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.41.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/top_level.txt b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee171b9ce88fa902be1b06281de4ce7ade6e10f9 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/pytablewriter-1.2.0.dist-info/top_level.txt @@ -0,0 +1 @@ +pytablewriter diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4e4286ecd606e8ad67df1bfa51903de1347bfe2 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__version__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__version__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc2a262eddd0217c89a9a644bd57b3a0fe1530d0 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/__version__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_common.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_common.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7f17d2b60dcdb57551d537642565a0075229df8 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_common.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_constant.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_constant.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2b3e283e34f20213494312f6f50760bc686def4 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_constant.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_converter.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_converter.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..050ae6241883884244945bae9542f7bdc4bbcb7a Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_converter.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_core.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_core.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8467706976f4d4a99f65ba420f6e040c9aeda5d8 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/_core.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/error.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/error.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a030bbca7bed688477e034a3bdcfaa4230dea44 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/error.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/normalizer.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/normalizer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7a6c0b638df947c548ed3eaf368dfc4622986bd Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/__pycache__/normalizer.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__init__.py b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d44359bc3ce26bdc62774951de78b91d6bce52e8 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__init__.py @@ -0,0 +1 @@ +from ._logger import logger, set_log_level, set_logger diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/__init__.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bef97385f71d72ceb377ba07e47df2b4e8a17d21 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/__init__.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_logger.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_logger.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1006184875dfbc3d63d85ab7326df547f5e3566 Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_logger.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_null_logger.cpython-310.pyc b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_null_logger.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..236979a9fa619c953e330816bef63cd94e2cfe6d Binary files /dev/null and b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/__pycache__/_null_logger.cpython-310.pyc differ diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_logger.py b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_logger.py new file mode 100644 index 0000000000000000000000000000000000000000..d6aa5e7e7701b43bb6b8aab422dff56e9881ff1c --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_logger.py @@ -0,0 +1,39 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import warnings + +import dataproperty + +from ._null_logger import NullLogger # type: ignore + + +MODULE_NAME = "tabledata" + +try: + from loguru import logger + + logger.disable(MODULE_NAME) +except ImportError: + logger = NullLogger() + + +def set_logger(is_enable: bool, propagation_depth: int = 1) -> None: + if is_enable: + logger.enable(MODULE_NAME) + else: + logger.disable(MODULE_NAME) + + if propagation_depth <= 0: + return + + dataproperty.set_logger(is_enable, propagation_depth - 1) + + +def set_log_level(log_level): # type: ignore + warnings.warn( + "'set_log_level' method is deprecated and will be removed in the future. ", + DeprecationWarning, + ) + return diff --git a/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_null_logger.py b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_null_logger.py new file mode 100644 index 0000000000000000000000000000000000000000..1de427a45ad4986de92d71eea6a657aceb095766 --- /dev/null +++ b/llmeval-env/lib/python3.10/site-packages/tabledata/_logger/_null_logger.py @@ -0,0 +1,44 @@ +# type: ignore + + +class NullLogger: + level_name = None + + def remove(self, handler_id=None): # pragma: no cover + pass + + def add(self, sink, **kwargs): # pragma: no cover + pass + + def disable(self, name): # pragma: no cover + pass + + def enable(self, name): # pragma: no cover + pass + + def critical(self, __message, *args, **kwargs): # pragma: no cover + pass + + def debug(self, __message, *args, **kwargs): # pragma: no cover + pass + + def error(self, __message, *args, **kwargs): # pragma: no cover + pass + + def exception(self, __message, *args, **kwargs): # pragma: no cover + pass + + def info(self, __message, *args, **kwargs): # pragma: no cover + pass + + def log(self, __level, __message, *args, **kwargs): # pragma: no cover + pass + + def success(self, __message, *args, **kwargs): # pragma: no cover + pass + + def trace(self, __message, *args, **kwargs): # pragma: no cover + pass + + def warning(self, __message, *args, **kwargs): # pragma: no cover + pass