utils.py — requests Source File
Architecture documentation for utils.py, a python file in the requests codebase. 2 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 401710e9_48ff_8931_a59f_9cf0334b86f2["utils.py"] c719cb58_682a_f9be_9cd6_9d93810c7780["contextlib"] 401710e9_48ff_8931_a59f_9cf0334b86f2 --> c719cb58_682a_f9be_9cd6_9d93810c7780 ee4485bf_7f24_0a4f_5207_2b9a2d911e29["os"] 401710e9_48ff_8931_a59f_9cf0334b86f2 --> ee4485bf_7f24_0a4f_5207_2b9a2d911e29 48561d17_8bd1_bf20_5710_ec3053a534d2["test_lowlevel.py"] 48561d17_8bd1_bf20_5710_ec3053a534d2 --> 401710e9_48ff_8931_a59f_9cf0334b86f2 69ebfd6f_8f0c_4586_0c19_2c348e1a42a2["test_requests.py"] 69ebfd6f_8f0c_4586_0c19_2c348e1a42a2 --> 401710e9_48ff_8931_a59f_9cf0334b86f2 style 401710e9_48ff_8931_a59f_9cf0334b86f2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import contextlib
import os
@contextlib.contextmanager
def override_environ(**kwargs):
save_env = dict(os.environ)
for key, value in kwargs.items():
if value is None:
del os.environ[key]
else:
os.environ[key] = value
try:
yield
finally:
os.environ.clear()
os.environ.update(save_env)
Domain
Subdomains
Functions
Dependencies
- contextlib
- os
Imported By
Source
Frequently Asked Questions
What does utils.py do?
utils.py is a source file in the requests codebase, written in python. It belongs to the CoreAPI domain, VerbHandlers subdomain.
What functions are defined in utils.py?
utils.py defines 1 function(s): override_environ.
What does utils.py depend on?
utils.py imports 2 module(s): contextlib, os.
What files import utils.py?
utils.py is imported by 2 file(s): test_lowlevel.py, test_requests.py.
Where is utils.py in the architecture?
utils.py is located at tests/utils.py (domain: CoreAPI, subdomain: VerbHandlers, directory: tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free