_BaseResource Class — langchain Architecture
Architecture documentation for the _BaseResource class in test_shell_execution_policies.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cfd1c01c_68eb_b5ac_b80c_13350ae2a1f0["_BaseResource"] 6b16168d_9880_7f41_060c_9fcd5b337996["test_shell_execution_policies.py"] cfd1c01c_68eb_b5ac_b80c_13350ae2a1f0 -->|defined in| 6b16168d_9880_7f41_060c_9fcd5b337996 2d1cf0fa_162b_a9a6_b7f1_0bc08ed2daf1["__init__()"] cfd1c01c_68eb_b5ac_b80c_13350ae2a1f0 -->|method| 2d1cf0fa_162b_a9a6_b7f1_0bc08ed2daf1 30b1f2af_e7ce_4dbf_9320_fca84a8ea1dc["setrlimit()"] cfd1c01c_68eb_b5ac_b80c_13350ae2a1f0 -->|method| 30b1f2af_e7ce_4dbf_9320_fca84a8ea1dc
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_execution_policies.py lines 32–44
class _BaseResource:
RLIMIT_CPU = 0
RLIMIT_DATA = 2
if has_rlimit_as:
RLIMIT_AS = 1
def __init__(self) -> None:
self.prlimit_calls: list[tuple[int, int, tuple[int, int]]] = []
self.setrlimit_calls: list[tuple[int, tuple[int, int]]] = []
def setrlimit(self, resource_name: int, limits: tuple[int, int]) -> None:
self.setrlimit_calls.append((resource_name, limits))
Source
Frequently Asked Questions
What is the _BaseResource class?
_BaseResource is a class in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_execution_policies.py.
Where is _BaseResource defined?
_BaseResource is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_execution_policies.py at line 32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free