MCPcopy Create free account
hub / github.com/catboost/catboost / enable

Function enable

library/python/import_tracing/lib/regulator.py:33–58  ·  view source on GitHub ↗
(filemask)

Source from the content-addressed store, hash-verified

31
32
33def enable(filemask):
34 import library.python.import_tracing.lib.import_tracer as import_tracer
35 import __res
36
37 global INSTANCE
38
39 if INSTANCE is not None:
40 return INSTANCE
41
42 converter = _get_converter_instance()
43 import_tracer = import_tracer.ImportTracer()
44
45 def before_import_callback(modname, filename):
46 import_tracer.start_event(modname, filename)
47
48 def after_import_callback(modname, filename):
49 import_tracer.finish_event(modname, filename)
50
51 __res.importer.set_callbacks(before_import_callback, after_import_callback)
52
53 filepath = _resolve_filepath(filemask)
54
55 new_instance = _Instance(import_tracer, converter, filepath)
56 INSTANCE = new_instance
57
58 return new_instance
59
60
61def disable(close_not_finished=False):

Callers

nothing calls this directly

Calls 3

_get_converter_instanceFunction · 0.85
_resolve_filepathFunction · 0.85
set_callbacksMethod · 0.80

Tested by

no test coverage detected