code: def _safe_input(msg, *, alt=None, use=None):
      try:
          return input(msg)
      except EOFError:  # MATLAB or other non-stdin
          if use is not None:
              return use
          raise RuntimeError(
              f"Could not use input() to get a response to:\n{msg}\n"
              f"You can {alt} to avoid this error."
          )
  
imports: import numbers
  import operator
  import os
  import re
  from builtins import input
  from difflib import get_close_matches
  from importlib import import_module
  from pathlib import Path
  import numpy
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..fixes import _compare_version, _median_complex
  from ._logging import _record_warnings, _verbose_safe_false, logger, verbose, warn
label_desc: Use image node_id 49 for calling a global function with example usage: _safe_input(msg) and returns: input, use