code: def errstate(
      *,
      divide=None,
      over=None,
      under=None,
      invalid=None,
      linalg=None,
      fallback_mode=None,
  ):
      """
      TODO(hvy): Write docs.
      """
      old_state = seterr(
          divide=divide,
          over=over,
          under=under,
          invalid=invalid,
          linalg=linalg,
          fallback_mode=fallback_mode,
      )
      try:
          yield  # Return `None` similar to `numpy.errstate`.
      finally:
          seterr(**old_state)
  
file_path: cupy/cupyx/_ufunc_config.py
imports: import contextlib
  import threading
label_desc: Use image node_id 7 for calling a global function with example usage: errstate() without return types