code: def modified_environ(update):
      """Temporarily updates the ``os.environ`` dictionary in-place.
  
      The ``os.environ`` dictionary is updated in-place so that the modification
      is sure to work in all situations.
  
      Args:
          update: Dictionary of environment variables and values to add/update.
      """
      update = update or {}
      original_env = {k: os.environ.get(k) for k in update}
  
      try:
          os.environ.update(update)
          yield
      finally:
          for k, v in original_env.items():
              if v is None:
                  os.environ.pop(k, None)
              else:
                  os.environ[k] = v
  
file_path: mlflow/mlflow/utils/_spark_utils.py
imports: import contextlib
  import os
  import shutil
  import tempfile
  import zipfile
label_desc: Use image node_id 6 for calling a global function with example usage: modified_environ(update) without return types