dycw-utilities 0.112.13__py3-none-any.whl → 0.112.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dycw_utilities-0.112.13.dist-info → dycw_utilities-0.112.14.dist-info}/METADATA +1 -1
- {dycw_utilities-0.112.13.dist-info → dycw_utilities-0.112.14.dist-info}/RECORD +6 -6
- utilities/__init__.py +1 -1
- utilities/more_itertools.py +31 -1
- {dycw_utilities-0.112.13.dist-info → dycw_utilities-0.112.14.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.112.13.dist-info → dycw_utilities-0.112.14.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=CIhTEeq-pbU3Wh1aAi3xUU9ERIQ-sVu7LwD2EjBeNps,61
|
2
2
|
utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
|
3
3
|
utilities/astor.py,sha256=xuDUkjq0-b6fhtwjhbnebzbqQZAjMSHR1IIS5uOodVg,777
|
4
4
|
utilities/asyncio.py,sha256=41oQUurWMvadFK5gFnaG21hMM0Vmfn2WS6OpC0R9mas,14757
|
@@ -35,7 +35,7 @@ utilities/luigi.py,sha256=fpH9MbxJDuo6-k9iCXRayFRtiVbUtibCJKugf7ygpv0,5988
|
|
35
35
|
utilities/math.py,sha256=TexfvLCI12d9Sw5_W4pKVBZ3nRr3zk2iPkcEU7xdEWU,26771
|
36
36
|
utilities/memory_profiler.py,sha256=tf2C51P2lCujPGvRt2Rfc7VEw5LDXmVPCG3z_AvBmbU,962
|
37
37
|
utilities/modules.py,sha256=iuvLluJya-hvl1Q25-Jk3dLgx2Es3ck4SjJiEkAlVTs,3195
|
38
|
-
utilities/more_itertools.py,sha256=
|
38
|
+
utilities/more_itertools.py,sha256=6T0225gBFZtv47-B0JRFOKMz836Wg3Hct79ePPLGpuo,5827
|
39
39
|
utilities/numpy.py,sha256=Xn23sA2ZbVNqwUYEgNJD3XBYH6IbCri_WkHSNhg3NkY,26122
|
40
40
|
utilities/operator.py,sha256=0M2yZJ0PODH47ogFEnkGMBe_cfxwZR02T_92LZVZvHo,3715
|
41
41
|
utilities/optuna.py,sha256=loyJGWTzljgdJaoLhP09PT8Jz6o_pwBOwehY33lHkhw,1923
|
@@ -87,7 +87,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
87
87
|
utilities/whenever.py,sha256=iLRP_-8CZtBpHKbGZGu-kjSMg1ZubJ-VSmgSy7Eudxw,17787
|
88
88
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
89
89
|
utilities/zoneinfo.py,sha256=-Xm57PMMwDTYpxJdkiJG13wnbwK--I7XItBh5WVhD-o,1874
|
90
|
-
dycw_utilities-0.112.
|
91
|
-
dycw_utilities-0.112.
|
92
|
-
dycw_utilities-0.112.
|
93
|
-
dycw_utilities-0.112.
|
90
|
+
dycw_utilities-0.112.14.dist-info/METADATA,sha256=j1h-dnkoSmxpcQeVqNPWmJynfitGt61YQFT3liw1LuU,13005
|
91
|
+
dycw_utilities-0.112.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
92
|
+
dycw_utilities-0.112.14.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
93
|
+
dycw_utilities-0.112.14.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/more_itertools.py
CHANGED
@@ -32,6 +32,9 @@ _T = TypeVar("_T")
|
|
32
32
|
_U = TypeVar("_U")
|
33
33
|
|
34
34
|
|
35
|
+
##
|
36
|
+
|
37
|
+
|
35
38
|
@overload
|
36
39
|
def bucket_mapping(
|
37
40
|
iterable: Iterable[_T], func: Callable[[_T], THashable], /, *, list: Literal[True]
|
@@ -55,6 +58,20 @@ def bucket_mapping(
|
|
55
58
|
return mapping
|
56
59
|
|
57
60
|
|
61
|
+
##
|
62
|
+
|
63
|
+
|
64
|
+
def partition_list(
|
65
|
+
pred: Callable[[_T], bool], iterable: Iterable[_T], /
|
66
|
+
) -> tuple[list[_T], list[_T]]:
|
67
|
+
"""Partition with lists."""
|
68
|
+
false, true = partition(pred, iterable)
|
69
|
+
return list(false), list(true)
|
70
|
+
|
71
|
+
|
72
|
+
##
|
73
|
+
|
74
|
+
|
58
75
|
def partition_typeguard(
|
59
76
|
pred: Callable[[_T], TypeGuard[_U]], iterable: Iterable[_T], /
|
60
77
|
) -> tuple[Iterator[_T], Iterator[_U]]:
|
@@ -64,6 +81,9 @@ def partition_typeguard(
|
|
64
81
|
return false, true
|
65
82
|
|
66
83
|
|
84
|
+
##
|
85
|
+
|
86
|
+
|
67
87
|
class peekable(_peekable, Generic[_T]): # noqa: N801
|
68
88
|
"""Peekable which supports dropwhile/takewhile methods."""
|
69
89
|
|
@@ -98,6 +118,9 @@ class peekable(_peekable, Generic[_T]): # noqa: N801
|
|
98
118
|
yield next(self)
|
99
119
|
|
100
120
|
|
121
|
+
##
|
122
|
+
|
123
|
+
|
101
124
|
@dataclass(kw_only=True, slots=True)
|
102
125
|
class Split(Generic[_T]):
|
103
126
|
"""An iterable split into head/tail."""
|
@@ -184,4 +207,11 @@ def _yield_splits3(
|
|
184
207
|
)
|
185
208
|
|
186
209
|
|
187
|
-
__all__ = [
|
210
|
+
__all__ = [
|
211
|
+
"Split",
|
212
|
+
"bucket_mapping",
|
213
|
+
"partition_list",
|
214
|
+
"partition_typeguard",
|
215
|
+
"peekable",
|
216
|
+
"yield_splits",
|
217
|
+
]
|
File without changes
|
File without changes
|