Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def decorate(function):
target_code_object = function.__code__
tracer = Tracer(
target_code_object=target_code_object, write=write,
truncate=truncate, watch=watch, watch_explode=watch_explode,
depth=depth, prefix=prefix, overwrite=overwrite
)
def inner(function_, *args, **kwargs):
with tracer:
return function(*args, **kwargs)
return decorator.decorate(function, inner)