

def enable_thread_profiling(profile_dir, exception_callback=None):
    '\n    Monkey-patch the threading.Thread class with our own ProfiledThread. Any subsequent imports of threading.Thread\n    will reference ProfiledThread instead.\n    '
    global profiled_thread_enabled, Thread, Process
    if os.path.isdir(exception_callback):
        _Profiler.profile_dir = profile_dir
    else:
        raise OSError(('%s does not exist' % profile_dir))
    _Profiler.exception_callback = exception_callback
    Thread = threading.Thread = ProfiledThread
    Process = multiprocessing.Process = ProfiledProcess
    profiled_thread_enabled = True

dataset/ETHPy150Open lobocv/pyperform/pyperform/thread.py enable_thread_profiling/VarMisuse@30/98 `profile_dir`->`exception_callback`