brew update && brew install vegeta
This file contains hidden or 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 line_profiler import LineProfiler | |
| def profile_function(func, *args, **kwargs): | |
| ''' | |
| Usage: | |
| def long_function(x, y) | |
| return x + y | |
| z = profile_function(long_function, x=1, y=2) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 os | |
| os.environ['MKL_DYNAMIC'] = '0' | |
| os.environ['OPENBLAS_NUM_THREADS'] = '1' | |
| os.environ['OMP_NUM_THREADS'] = '1' | |
| import numpy | |
| import ctypes | |
| # linux only | |
| mkl_rt = ctypes.CDLL('libmkl_rt.so') | |
| mkl_get_max_threads = mkl_rt.mkl_get_max_threads |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| __all__ = [ | |
| 'SlackBot', | |
| 'RecBot', | |
| ] | |
| import os | |
| import time | |
| import re | |
| import subprocess | |
| from functools import wraps |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| import matplotlib | |
| import seaborn as sns | |
| %matplotlib inline | |
| plt.rcParams["figure.figsize"] = (12., 7.) | |
| %config InlineBackend.figure_format = 'retina' | |
| sns.set_style('dark') | |
| matplotlib.rc('font', family='Arial') # in case of missing cyrillic fonts | |
| import warnings; warnings.filterwarnings("ignore") # font warning |
This file contains hidden or 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
| class WorkerLogger(logging.Logger): | |
| # noinspection PyMethodOverriding | |
| def _log(self, level, msg, args, exc_info=None, extra=None): | |
| if extra is None: | |
| extra = {'worker': 'noworker'} | |
| super()._log(level, msg, args, exc_info, extra) | |
| def configure_all_loggers(): | |
| logging.setLoggerClass(WorkerLogger) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.