MCPcopy Create free account
hub / github.com/SooLab/CGFormer / get_caller_name

Function get_caller_name

utils/misc.py:211–225  ·  view source on GitHub ↗

Args: depth (int): Depth of caller conext, use 0 for caller depth. Default value: 0. Returns: str: module name of the caller

(depth=0)

Source from the content-addressed store, hash-verified

209
210
211def get_caller_name(depth=0):
212 """
213 Args:
214 depth (int): Depth of caller conext, use 0 for caller depth.
215 Default value: 0.
216
217 Returns:
218 str: module name of the caller
219 """
220 # the following logic is a little bit faster than inspect.stack() logic
221 frame = inspect.currentframe().f_back
222 for _ in range(depth):
223 frame = frame.f_back
224
225 return frame.f_globals["__name__"]
226
227
228class StreamToLoguru:

Callers 1

writeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected