Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@wraps(func, injected=["b"])
def wrapped(a, *args, **kwargs):
return func(a, 2, *args, **kwargs)
return wrapped
@wraps(wrapped)
async def decorator(*args, **kw):
return (await wrapped(*args, **kw))
return decorator
@wraps(func, update_dict=True)
def wrapped(*args, **kwargs):
return func(*args, **kwargs)
return wrapped
@wraps(func)
def cedar_wrapper(*a, **kw):
return (flag, func.__name__, func(*a, **kw))
return cedar_wrapper
@wraps(func, foo="bar")
def wrapped(*args, **kwargs):
return func(*args, **kwargs)
return wrapped
@wraps(func, injected="c", inject_to_varkw=False)
def wrapped(*args, **kwargs):
return func(c=1, *args, **kwargs)
return wrapped
@wraps(func)
async def wrapped(*args, **kw):
await asyncio.sleep(1.0)
return await func(*args, **kw)
@wraps(func)
def cedar_wrapper(*a, **kw):
return (flag, func.__name__, func(*a, **kw))
return cedar_wrapper
@bfu.wraps(f)
def _when_type(val):
if isinstance(val, type):
return f(val)
else:
return val
@wraps(func)
def mutated(*args, **kwargs):
result = func(*args, **kwargs)
return get_mutation_result(result)