code: def override_temp(replacement):
      """
      Monkey-patch tempfile.tempdir with replacement, ensuring it exists
      """
      os.makedirs(replacement, exist_ok=True)
  
      saved = tempfile.tempdir
  
      tempfile.tempdir = replacement
  
      try:
          yield
      finally:
          tempfile.tempdir = saved
  
imports: import os
  import sys
  import tempfile
  import operator
  import functools
  import itertools
  import re
  import contextlib
  import pickle
  import textwrap
  import builtins
  import pkg_resources
  from distutils.errors import DistutilsError
  from pkg_resources import working_set
label_desc: Use image node_id 4 for calling a global function with example usage: override_temp(replacement) without return types