code: def env(**kwargs):
      # ignore args with None values
      for k in list(kwargs.keys()):
          if kwargs[k] is None:
              del kwargs[k]
  
      # backup environment
      backup = {}
      for k in kwargs.keys():
          backup[k] = os.environ.get(k)
  
      # set new values & yield
      for k, v in kwargs.items():
          os.environ[k] = v
  
      try:
          yield
      finally:
          # restore environment
          for k in kwargs.keys():
              if backup[k] is not None:
                  os.environ[k] = backup[k]
              else:
                  del os.environ[k]
  
imports: import json
  import multiprocessing
  import os
  import sys
  import sysconfig
  import warnings
  from contextlib import contextmanager
  from horovod.common.exceptions import get_version_mismatch_message, HorovodVersionMismatchError
label_desc: Use image node_id 13 for calling a global function with example usage: env() without return types