code: def modified_environ(*remove, **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.
  
      :param remove: Environment variables to remove.
      :param update: Dictionary of environment variables and values to add/update.
      """
      env = os.environ
      update = update or {}
      remove = remove or []
  
      # List of environment variables being updated or removed.
      stomped = (set(update.keys()) | set(remove)) & set(env.keys())
      # Environment variables and values to restore on exit.
      update_after = {k: env[k] for k in stomped}
      # Environment variables and values to remove on exit.
      remove_after = frozenset(k for k in update if k not in env)
  
      try:
          env.update(update)
          for k in remove:
              env.pop(k, None)
          yield
      finally:
          env.update(update_after)
          for k in remove_after:
              env.pop(k)
  
imports: import io
  import os
  import random
  import string
  import tempfile
  from contextlib import contextmanager
  from datetime import datetime
  from math import sqrt
  from time import perf_counter
  import numpy
  from attr import dataclass
  from PIL import Image
  from PIL.PngImagePlugin import PngImageFile
  import neptune
  from neptune.internal.container_type import ContainerType
  from tests.e2e.exceptions import MissingEnvironmentVariable
label_desc: Use image node_id 12 for calling a global function with example usage: modified_environ() without return types