Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.52
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
Users /
VEGETA /
Envs /
Pessoais /
Lib /
site-packages /
Delete
Unzip
Name
Size
Permission
Date
Action
Django-5.0.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
EasyProcess-1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
Flask-2.2.5.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
Jinja2-3.1.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
MarkupSafe-2.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
MouseInfo-0.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PIL
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
Pillow-9.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
PyAutoGUI-0.9.54.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyGetWindow-0.0.9.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyMsgBox-1.0.9.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyMySQL-1.1.0.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:21
PyRect-0.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyScreeze-0.1.29.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
Werkzeug-2.2.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
__pycache__
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
_distutils_hack
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
_plotly_future_
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
_plotly_utils
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
aiohttp
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiohttp-3.9.3.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiosignal
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiosignal-1.3.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
ansi2html
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
ansi2html-1.8.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
asgiref
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
asgiref-3.7.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
attr
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
attrs
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
attrs-23.2.0.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
bcrypt
[ DIR ]
drwxrwxrwx
2024-03-07 15:54
bcrypt-4.1.2.dist-info
[ DIR ]
drwxrwxrwx
2024-03-07 15:54
beautifulsoup4-4.12.2.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
blinker
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
blinker-1.6.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
body
[ DIR ]
drwxrwxrwx
2024-03-12 18:33
body-0.1.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:33
bs4
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
certifi
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
certifi-2023.5.7.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
chardet
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
chardet-3.0.4.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
charset_normalizer
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
charset_normalizer-3.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
click
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
click-8.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
colorama
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
colorama-0.4.6.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
contourpy
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
contourpy-1.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
cycler-0.11.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
dash
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
dash-2.11.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
dash_core_components
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_core_components-2.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_html_components
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_html_components-2.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_table
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_table-5.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dateutil
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
discord
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
discord-2.3.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
discord.py-2.3.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
django
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
django_scheduler-0.10.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
easyprocess
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
entrypoint2
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
entrypoint2-1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
flask
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
fontTools
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
fonttools-4.40.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
frozenlist
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
frozenlist-1.4.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
game
[ DIR ]
drwxrwxrwx
2024-03-11 21:24
game-0.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-11 21:24
google-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:29
googlesearch
[ DIR ]
drwxrwxrwx
2023-11-15 23:29
googletrans
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
googletrans-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h11
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h11-0.9.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h2
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h2-3.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hpack
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hpack-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hstspreload
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hstspreload-2023.1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpcore
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpcore-0.9.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpx
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpx-0.13.3.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hyperframe
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hyperframe-5.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
icalendar
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
icalendar-5.0.11.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
icon
[ DIR ]
drwxrwxrwx
2024-03-05 14:04
icon-0.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-05 14:04
idna
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
idna-2.10.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
itsdangerous
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
itsdangerous-2.1.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
jinja2
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
jupyterlab_plotly
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
kiwisolver
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
kiwisolver-1.4.4.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
libretranslatepy
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
libretranslatepy-2.1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
lxml
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
lxml-4.9.3.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
markupsafe
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
matplotlib
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
matplotlib-3.7.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
matplotlib.libs
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
mouseinfo
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
mpl_toolkits
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
mss
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
mss-9.0.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
multidict
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
multidict-6.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
nest_asyncio-1.5.6.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
numpy
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
numpy-1.25.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
packaging
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
packaging-23.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pandas
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pandas-2.0.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pexpect
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
pexpect-4.8.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
pip
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
pip-23.0.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
pkg_resources
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
plotly
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
plotly-5.15.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
psutil
[ DIR ]
drwxrwxrwx
2023-11-20 14:08
psutil-5.9.6.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 14:08
ptyprocess
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
ptyprocess-0.7.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
py4j
[ DIR ]
drwxrwxrwx
2023-10-10 16:08
py4j-0.10.9.7.dist-info
[ DIR ]
drwxrwxrwx
2023-10-10 16:08
pyautogui
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyfiglet
[ DIR ]
drwxrwxrwx
2024-02-26 00:55
pyfiglet-1.0.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-26 00:55
pygame
[ DIR ]
drwxrwxrwx
2023-06-29 04:25
pygame-2.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:25
pygetwindow
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pymsgbox
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pymysql
[ DIR ]
drwxrwxrwx
2024-02-20 18:21
pyparsing
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pyparsing-3.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pyperclip
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyperclip-1.8.2.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyrect
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreenshot
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreenshot-3.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreeze
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyspark
[ DIR ]
drwxrwxrwx
2023-10-10 16:09
pyspark-3.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-10-10 16:09
pystray
[ DIR ]
drwxrwxrwx
2024-03-05 14:09
pystray-0.19.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-05 14:09
python_dateutil-2.8.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pytweening
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pytweening-1.0.7.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pytz
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pytz-2023.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
requests
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
requests-2.31.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
retrying-1.3.4.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
rfc3986
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
rfc3986-1.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
scapy
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
scapy-2.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
schedule
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
setuptools
[ DIR ]
drwxrwxrwx
2023-09-21 16:49
setuptools-67.6.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
six-1.16.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
sniffio
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
sniffio-1.3.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
soupsieve
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
soupsieve-2.5.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
sqlparse
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
sqlparse-0.4.4.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
startrek
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
startrek-0.4.2.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
tabulate
[ DIR ]
drwxrwxrwx
2024-03-12 19:19
tabulate-0.9.0.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 19:19
tcp
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
tcp-0.4.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
telnetlib3
[ DIR ]
drwxrwxrwx
2023-09-21 15:21
telnetlib3-2.0.4.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 15:21
tenacity
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tenacity-8.2.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
test
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
tests
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
translate
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
translate-3.6.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
typing_extensions-4.7.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tzdata
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tzdata-2023.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
udp
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
udp-0.5.10.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
urllib3
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
urllib3-2.0.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
urwid
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
urwid-2.6.8.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
wcwidth
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
wcwidth-0.2.13.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
werkzeug
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
wheel
[ DIR ]
drwxrwxrwx
2023-09-21 16:49
wheel-0.40.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
yarl
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
yarl-1.9.4.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
_virtualenv.pth
18
B
-rw-rw-rw-
2023-06-29 03:40
_virtualenv.py
5.63
KB
-rw-rw-rw-
2023-06-29 03:40
cycler.py
14.18
KB
-rw-rw-rw-
2023-06-29 03:41
distutils-precedence.pth
151
B
-rw-rw-rw-
2023-06-29 03:40
matplotlib-3.7.1-py3.11-nspkg.pth
570
B
-rw-rw-rw-
2023-06-29 03:41
nest_asyncio.py
7.6
KB
-rw-rw-rw-
2023-06-29 04:17
pip-23.0.1.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
pylab.py
93
B
-rw-rw-rw-
2023-06-29 03:41
retrying.py
11
KB
-rw-rw-rw-
2023-06-29 04:17
setuptools-67.6.0.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
six.py
33.74
KB
-rw-rw-rw-
2023-06-29 03:41
typing_extensions.py
107.76
KB
-rw-rw-rw-
2023-06-29 04:17
wheel-0.40.0.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
Save
Rename
""" Cycler ====== Cycling through combinations of values, producing dictionaries. You can add cyclers:: from cycler import cycler cc = (cycler(color=list('rgb')) + cycler(linestyle=['-', '--', '-.'])) for d in cc: print(d) Results in:: {'color': 'r', 'linestyle': '-'} {'color': 'g', 'linestyle': '--'} {'color': 'b', 'linestyle': '-.'} You can multiply cyclers:: from cycler import cycler cc = (cycler(color=list('rgb')) * cycler(linestyle=['-', '--', '-.'])) for d in cc: print(d) Results in:: {'color': 'r', 'linestyle': '-'} {'color': 'r', 'linestyle': '--'} {'color': 'r', 'linestyle': '-.'} {'color': 'g', 'linestyle': '-'} {'color': 'g', 'linestyle': '--'} {'color': 'g', 'linestyle': '-.'} {'color': 'b', 'linestyle': '-'} {'color': 'b', 'linestyle': '--'} {'color': 'b', 'linestyle': '-.'} """ import copy from functools import reduce from itertools import product, cycle from operator import mul, add __version__ = '0.10.0' def _process_keys(left, right): """ Helper function to compose cycler keys. Parameters ---------- left, right : iterable of dictionaries or None The cyclers to be composed. Returns ------- keys : set The keys in the composition of the two cyclers. """ l_peek = next(iter(left)) if left is not None else {} r_peek = next(iter(right)) if right is not None else {} l_key = set(l_peek.keys()) r_key = set(r_peek.keys()) if l_key & r_key: raise ValueError("Can not compose overlapping cycles") return l_key | r_key def concat(left, right): r""" Concatenate `Cycler`\s, as if chained using `itertools.chain`. The keys must match exactly. Examples -------- >>> num = cycler('a', range(3)) >>> let = cycler('a', 'abc') >>> num.concat(let) cycler('a', [0, 1, 2, 'a', 'b', 'c']) Returns ------- `Cycler` The concatenated cycler. """ if left.keys != right.keys: raise ValueError("Keys do not match:\n" "\tIntersection: {both!r}\n" "\tDisjoint: {just_one!r}".format( both=left.keys & right.keys, just_one=left.keys ^ right.keys)) _l = left.by_key() _r = right.by_key() return reduce(add, (_cycler(k, _l[k] + _r[k]) for k in left.keys)) class Cycler: """ Composable cycles. This class has compositions methods: ``+`` for 'inner' products (zip) ``+=`` in-place ``+`` ``*`` for outer products (`itertools.product`) and integer multiplication ``*=`` in-place ``*`` and supports basic slicing via ``[]``. Parameters ---------- left, right : Cycler or None The 'left' and 'right' cyclers. op : func or None Function which composes the 'left' and 'right' cyclers. """ def __call__(self): return cycle(self) def __init__(self, left, right=None, op=None): """ Semi-private init. Do not use this directly, use `cycler` function instead. """ if isinstance(left, Cycler): self._left = Cycler(left._left, left._right, left._op) elif left is not None: # Need to copy the dictionary or else that will be a residual # mutable that could lead to strange errors self._left = [copy.copy(v) for v in left] else: self._left = None if isinstance(right, Cycler): self._right = Cycler(right._left, right._right, right._op) elif right is not None: # Need to copy the dictionary or else that will be a residual # mutable that could lead to strange errors self._right = [copy.copy(v) for v in right] else: self._right = None self._keys = _process_keys(self._left, self._right) self._op = op def __contains__(self, k): return k in self._keys @property def keys(self): """The keys this Cycler knows about.""" return set(self._keys) def change_key(self, old, new): """ Change a key in this cycler to a new name. Modification is performed in-place. Does nothing if the old key is the same as the new key. Raises a ValueError if the new key is already a key. Raises a KeyError if the old key isn't a key. """ if old == new: return if new in self._keys: raise ValueError( "Can't replace {old} with {new}, {new} is already a key" .format(old=old, new=new) ) if old not in self._keys: raise KeyError("Can't replace {old} with {new}, {old} is not a key" .format(old=old, new=new)) self._keys.remove(old) self._keys.add(new) if self._right is not None and old in self._right.keys: self._right.change_key(old, new) # self._left should always be non-None # if self._keys is non-empty. elif isinstance(self._left, Cycler): self._left.change_key(old, new) else: # It should be completely safe at this point to # assume that the old key can be found in each # iteration. self._left = [{new: entry[old]} for entry in self._left] @classmethod def _from_iter(cls, label, itr): """ Class method to create 'base' Cycler objects that do not have a 'right' or 'op' and for which the 'left' object is not another Cycler. Parameters ---------- label : str The property key. itr : iterable Finite length iterable of the property values. Returns ------- `Cycler` New 'base' cycler. """ ret = cls(None) ret._left = list({label: v} for v in itr) ret._keys = {label} return ret def __getitem__(self, key): # TODO : maybe add numpy style fancy slicing if isinstance(key, slice): trans = self.by_key() return reduce(add, (_cycler(k, v[key]) for k, v in trans.items())) else: raise ValueError("Can only use slices with Cycler.__getitem__") def __iter__(self): if self._right is None: for left in self._left: yield dict(left) else: for a, b in self._op(self._left, self._right): out = {} out.update(a) out.update(b) yield out def __add__(self, other): """ Pair-wise combine two equal length cyclers (zip). Parameters ---------- other : Cycler """ if len(self) != len(other): raise ValueError("Can only add equal length cycles, " f"not {len(self)} and {len(other)}") return Cycler(self, other, zip) def __mul__(self, other): """ Outer product of two cyclers (`itertools.product`) or integer multiplication. Parameters ---------- other : Cycler or int """ if isinstance(other, Cycler): return Cycler(self, other, product) elif isinstance(other, int): trans = self.by_key() return reduce(add, (_cycler(k, v*other) for k, v in trans.items())) else: return NotImplemented def __rmul__(self, other): return self * other def __len__(self): op_dict = {zip: min, product: mul} if self._right is None: return len(self._left) l_len = len(self._left) r_len = len(self._right) return op_dict[self._op](l_len, r_len) def __iadd__(self, other): """ In-place pair-wise combine two equal length cyclers (zip). Parameters ---------- other : Cycler """ if not isinstance(other, Cycler): raise TypeError("Cannot += with a non-Cycler object") # True shallow copy of self is fine since this is in-place old_self = copy.copy(self) self._keys = _process_keys(old_self, other) self._left = old_self self._op = zip self._right = Cycler(other._left, other._right, other._op) return self def __imul__(self, other): """ In-place outer product of two cyclers (`itertools.product`). Parameters ---------- other : Cycler """ if not isinstance(other, Cycler): raise TypeError("Cannot *= with a non-Cycler object") # True shallow copy of self is fine since this is in-place old_self = copy.copy(self) self._keys = _process_keys(old_self, other) self._left = old_self self._op = product self._right = Cycler(other._left, other._right, other._op) return self def __eq__(self, other): if len(self) != len(other): return False if self.keys ^ other.keys: return False return all(a == b for a, b in zip(self, other)) def __ne__(self, other): return not (self == other) __hash__ = None def __repr__(self): op_map = {zip: '+', product: '*'} if self._right is None: lab = self.keys.pop() itr = list(v[lab] for v in self) return f"cycler({lab!r}, {itr!r})" else: op = op_map.get(self._op, '?') msg = "({left!r} {op} {right!r})" return msg.format(left=self._left, op=op, right=self._right) def _repr_html_(self): # an table showing the value of each key through a full cycle output = "<table>" sorted_keys = sorted(self.keys, key=repr) for key in sorted_keys: output += f"<th>{key!r}</th>" for d in iter(self): output += "<tr>" for k in sorted_keys: output += f"<td>{d[k]!r}</td>" output += "</tr>" output += "</table>" return output def by_key(self): """ Values by key. This returns the transposed values of the cycler. Iterating over a `Cycler` yields dicts with a single value for each key, this method returns a `dict` of `list` which are the values for the given key. The returned value can be used to create an equivalent `Cycler` using only `+`. Returns ------- transpose : dict dict of lists of the values for each key. """ # TODO : sort out if this is a bottle neck, if there is a better way # and if we care. keys = self.keys out = {k: list() for k in keys} for d in self: for k in keys: out[k].append(d[k]) return out # for back compatibility _transpose = by_key def simplify(self): """ Simplify the cycler into a sum (but no products) of cyclers. Returns ------- simple : Cycler """ # TODO: sort out if it is worth the effort to make sure this is # balanced. Currently it is is # (((a + b) + c) + d) vs # ((a + b) + (c + d)) # I would believe that there is some performance implications trans = self.by_key() return reduce(add, (_cycler(k, v) for k, v in trans.items())) concat = concat def cycler(*args, **kwargs): """ Create a new `Cycler` object from a single positional argument, a pair of positional arguments, or the combination of keyword arguments. cycler(arg) cycler(label1=itr1[, label2=iter2[, ...]]) cycler(label, itr) Form 1 simply copies a given `Cycler` object. Form 2 composes a `Cycler` as an inner product of the pairs of keyword arguments. In other words, all of the iterables are cycled simultaneously, as if through zip(). Form 3 creates a `Cycler` from a label and an iterable. This is useful for when the label cannot be a keyword argument (e.g., an integer or a name that has a space in it). Parameters ---------- arg : Cycler Copy constructor for Cycler (does a shallow copy of iterables). label : name The property key. In the 2-arg form of the function, the label can be any hashable object. In the keyword argument form of the function, it must be a valid python identifier. itr : iterable Finite length iterable of the property values. Can be a single-property `Cycler` that would be like a key change, but as a shallow copy. Returns ------- cycler : Cycler New `Cycler` for the given property """ if args and kwargs: raise TypeError("cyl() can only accept positional OR keyword " "arguments -- not both.") if len(args) == 1: if not isinstance(args[0], Cycler): raise TypeError("If only one positional argument given, it must " "be a Cycler instance.") return Cycler(args[0]) elif len(args) == 2: return _cycler(*args) elif len(args) > 2: raise TypeError("Only a single Cycler can be accepted as the lone " "positional argument. Use keyword arguments instead.") if kwargs: return reduce(add, (_cycler(k, v) for k, v in kwargs.items())) raise TypeError("Must have at least a positional OR keyword arguments") def _cycler(label, itr): """ Create a new `Cycler` object from a property name and iterable of values. Parameters ---------- label : hashable The property key. itr : iterable Finite length iterable of the property values. Returns ------- cycler : Cycler New `Cycler` for the given property """ if isinstance(itr, Cycler): keys = itr.keys if len(keys) != 1: msg = "Can not create Cycler from a multi-property Cycler" raise ValueError(msg) lab = keys.pop() # Doesn't need to be a new list because # _from_iter() will be creating that new list anyway. itr = (v[lab] for v in itr) return Cycler._from_iter(label, itr)