pandas/_testing/contexts.py
def ensure_safe_environment_variables():
    """
    Get a context manager to safely set environment variables

    All changes will be undone on close, hence environment variables set
    within this contextmanager will neither persist nor change global state.
    """
    saved_environ = dict(os.environ)
    try:
        yield
    finally:
        os.environ.clear()
        os.environ.update(saved_environ)

    Get a context manager to safely set environment variables

    All changes will be undone on close, hence environment variables set
    within this contextmanager will neither persist nor change global state.
    
Get a context manager to safely set environment variables
All changes will be undone on close, hence environment variables set
within this contextmanager will neither persist nor change global state.
Get a context manager to safely set environment variables All changes will be undone on close hence environment variables set within this contextmanager will neither persist nor change global state .
def ensure_safe_environment_variables():
    saved_environ = dict(os.environ)
    try:
        yield
    finally:
        os.environ.clear()
        os.environ.update(saved_environ)
def ensure_safe_environment_variables ( ) : saved_environ = dict ( os . environ ) try : yield finally : os . environ . clear ( ) os . environ . update ( saved_environ )
Get a context manager to safely set environment variables
All changes will be undone on close, hence environment variables set
within this contextmanager will neither persist nor change global state.
Get a context manager to safely set environment variables All changes will be undone on close hence environment variables set within this contextmanager will neither persist nor change global state .
"""
    Get a context manager to safely set environment variables

    All changes will be undone on close, hence environment variables set
    within this contextmanager will neither persist nor change global state.
    """