code: def safecall(
      func: "t.Callable[P, R]",
  ) -> "t.Callable[P, t.Optional[R]]":
      """Wraps a function so that it swallows exceptions."""
  
      def wrapper(
          *args: "P.args", **kwargs: "P.kwargs"
      ) -> t.Optional[R]:
          try:
              return func(*args, **kwargs)
          except Exception:
              pass
          return None
  
      return update_wrapper(wrapper, func)
  
imports: import os
  import re
  import sys
  import typing
  from functools import update_wrapper
  from types import ModuleType
  from types import TracebackType
  from ._compat import _default_text_stderr
  from ._compat import _default_text_stdout
  from ._compat import _find_binary_writer
  from ._compat import auto_wrap_for_ansi
  from ._compat import binary_streams
  from ._compat import open_stream
  from ._compat import should_strip_ansi
  from ._compat import strip_ansi
  from ._compat import text_streams
  from ._compat import WIN
  from .globals import resolve_color_default
label_desc: Use image node_id 2 for calling a global function with example usage: safecall(func) and returns: update_wrapper, None, func