MCPcopy Index your code
hub / github.com/prometheus/client_python / decorate

Function decorate

prometheus_client/decorator.py:229–239  ·  view source on GitHub ↗

decorate(func, caller) decorates a function using a caller.

(func, caller)

Source from the content-addressed store, hash-verified

227
228
229def decorate(func, caller):
230 """
231 decorate(func, caller) decorates a function using a caller.
232 """
233 evaldict = dict(_call_=caller, _func_=func)
234 fun = FunctionMaker.create(
235 func, "return _call_(_func_, %(shortsignature)s)",
236 evaldict, __wrapped__=func)
237 if hasattr(func, '__qualname__'):
238 fun.__qualname__ = func.__qualname__
239 return fun
240
241
242def decorator(caller, _func=None):

Callers 4

__call__Method · 0.85
__call__Method · 0.85
__call__Method · 0.85
decoratorFunction · 0.85

Calls 1

createMethod · 0.45

Tested by

no test coverage detected