code: def set_env(**environ):
      """
      Temporarily set the process environment variables.
  
      >>> with set_env(PLUGINS_DIR='test/plugins'):
      ...   "PLUGINS_DIR" in os.environ
      True
  
      >>> "PLUGINS_DIR" in os.environ
      False
  
      :type environ: dict[str, unicode]
      :param environ: Environment variables to set
      """
      old_environ = dict(os.environ)
      os.environ.update(environ)
      try:
          yield
      finally:
          os.environ.clear()
          os.environ.update(old_environ)
  
imports: import contextlib
  import itertools
  import math
  import operator
  import platform
  import hashlib
  import inspect
  import sys
  import uuid
  import os
  import asyncio
  import collections
  from pathlib import Path
  from snakemake._version import get_versions
  from snakemake_interface_common.exceptions import WorkflowError
label_desc: Use image node_id 22 for calling a global function with example usage: set_env() without return types