clear_locals() — anthropic-sdk-python Function Reference
Architecture documentation for the clear_locals() function in utils.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD c3357c12_fcce_22ef_51b2_90f3c4331d2d["clear_locals()"] fd640620_de49_331e_578e_1d363467c440["utils.py"] c3357c12_fcce_22ef_51b2_90f3c4331d2d -->|defined in| fd640620_de49_331e_578e_1d363467c440 e1a5f6ee_8492_7930_e986_7929e31489a2["print_obj()"] e1a5f6ee_8492_7930_e986_7929e31489a2 -->|calls| c3357c12_fcce_22ef_51b2_90f3c4331d2d 917f996e_7ea0_140e_285d_acc3b0f76d69["get_caller_name()"] c3357c12_fcce_22ef_51b2_90f3c4331d2d -->|calls| 917f996e_7ea0_140e_285d_acc3b0f76d69 style c3357c12_fcce_22ef_51b2_90f3c4331d2d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/lib/utils.py lines 58–60
def clear_locals(string: str, *, stacklevel: int) -> str:
caller = get_caller_name(stacklevel=stacklevel + 1)
return string.replace(f"{caller}.<locals>.", "")
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does clear_locals() do?
clear_locals() is a function in the anthropic-sdk-python codebase, defined in tests/lib/utils.py.
Where is clear_locals() defined?
clear_locals() is defined in tests/lib/utils.py at line 58.
What does clear_locals() call?
clear_locals() calls 1 function(s): get_caller_name.
What calls clear_locals()?
clear_locals() is called by 1 function(s): print_obj.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free