code: def safecall(
      fn: Callable[[], T],
      *,
      exc_types: Union[Type, Tuple[Type, ...]] = Exception,
      error_value: T,
  ) -> T:
      """A protected call that suppress certain types of exceptions."""
      try:
          return fn()
      except exc_types:  # pylint: disable=broad-except
          return error_value
  
file_path: gpustat/gpustat/util.py
imports: import collections
  import os.path
  import sys
  import traceback
  from typing import Callable, Tuple, Type, TypeVar, Union
label_desc: Use image node_id 4 for calling a global function with example usage: safecall(fn) and returns: fn, error_value