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 numpy as np | |
try: | |
import tensorflow as tf | |
except ImportError: | |
tf = None | |
from time import perf_counter | |
def timeit(func, *args, **kwargs): | |
durations = [] |
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
[bumpversion] | |
commit = True | |
tag = False | |
current_version = 1.2.0.dev0 | |
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))? | |
serialize = | |
{major}.{minor}.{patch}.{release}{build} | |
{major}.{minor}.{patch} | |
# inspired by: https://stackoverflow.com/a/64654668/8389830 |
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
DEFAULT_DIR = "/tmp/memory_profile" | |
class RunMprof: | |
def __init__(self): | |
self.thread: subprocess.Popen = None | |
def __enter__(self): | |
import datetime, os, pathlib |
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
#!/usr/bin/env python3 | |
import subprocess | |
import uuid | |
try: | |
import click | |
except ImportError: | |
print("install click: `pip install click`") | |
exit |