code: def working_or_temp_dir(working_dir, use_temp_dir: bool = False):
      if use_temp_dir:
          with tempfile.TemporaryDirectory() as tmp_dir:
              yield tmp_dir
      else:
          yield working_dir
  
imports: import inspect
  import tempfile
  from collections import OrderedDict, UserDict
  from collections.abc import MutableMapping
  from contextlib import ExitStack, contextmanager
  from dataclasses import fields, is_dataclass
  from enum import Enum
  from typing import Any, ContextManager, Iterable, List, Tuple
  import numpy
  from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy
label_desc: Use image node_id 24 for calling a global function with example usage: working_or_temp_dir(working_dir, use_temp_dir) without return types