code: def safemin(iterable, default=0):
      """Safer variant of ``min()`` that returns a default value if the iterable
      is empty.
  
      Example:
  
          >>> safemin([-5, 6, 4])
          -5
          >>> safemin([])
          0
          >>> safemin((), 2)
          2
      """
      it = iter(iterable)
      try:
          first = next(it)
      except StopIteration:
          return default
      else:
          return min(chain([first], it))
  
imports: from contextlib import contextmanager
  from collections.abc import MutableMapping
  from itertools import chain
  from warnings import warn
  import os
  import tempfile
label_desc: Use image node_id 8 for calling a global function with example usage: safemin(iterable, default) and returns: min, default