This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
import pickle | |
import struct | |
from typing import Optional, Callable, List, Any | |
from tqdm import tqdm | |
import pickle | |
import struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
System/Runtime Requirements: | |
>=Python3.7 | |
Linux / Mac | |
>=2 CPU Cores | |
Must pip install to run `processit`: | |
pickle5, tqdm | |
Must pip install to run the tests and some functions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
pip install \ | |
bigquery-schema-generator \ | |
google-api-python-client \ | |
pandas-gbq \ | |
pandas | |
""" | |
import logging | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
pip install \ | |
numpy \ | |
pandas \ | |
numba | |
""" | |
import time | |
from dataclasses import dataclass | |
from functools import wraps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
pip install \ | |
pandas \ | |
sqlalchemy \ | |
pyarrow | |
""" | |
import json | |
import os | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
NOTE: THIS IS NOT MY CODE. I'M JUST SAVING IT HERE. | |
--------------------------------------------------- | |
Easily put time restrictions on things | |
Note: Requires Python 3.x | |
Usage as a context manager: | |
``` | |
with timeout(10): | |
something_that_should_not_exceed_ten_seconds() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
from .diskcached import clear_all, diskcached | |
@diskcached() | |
def cached_fn(x): | |
print(x) | |
return x + 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Modified file (<VIRTUALENV>/lib/python3.7/site-packages/sqlalchemy/dialects/mssql/base.py) | |
for sqlalchemy==1.3.7 to get it to work with sqlacodegen==2.1.0 | |
for an Azure SQL Data Warehouse server using the following get_engine function: | |
``` | |
def get_engine(username=None, password=None, hostname=None, database=None) -> Engine: | |
from skykick_ds.runconfig import RunConfig | |
username = username or RunConfig.sql_username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
################ | |
# Installation # | |
################ | |
memory_profiler: | |
pip install memory-profiler | |
pympler: | |
pip install pympler |
OlderNewer