code: def seterr(
      all=None, divide=None, over=None, under=None, invalid=None
  ):
      """
      Set how floating-point errors are handled.
  
      Note that operations on integer scalar types (such as `int16`) are
      handled like floating point, and are affected by these settings.
  
      Parameters
      ----------
      all : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
          Set treatment for all types of floating-point errors at once:
  
          - ignore: Take no action when the exception occurs.
          - warn: Print a `RuntimeWarning` (via the Python `warnings` module).
          - raise: Raise a `FloatingPointError`.
          - call: Call a function specified using the `seterrcall` function.
          - print: Print a warning directly to ``stdout``.
          - log: Record error in a Log object specified by `seterrcall`.
  
          The default is not to change the current behavior.
      divide : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
          Treatment for division by zero.
      over : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
          Treatment for floating-point overflow.
      under : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
          Treatment for floating-point underflow.
      invalid : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
          Treatment for invalid floating-point operation.
  
      Returns
      -------
      old_settings : dict
          Dictionary containing the old settings.
  
      See also
      --------
      seterrcall : Set a callback function for the 'call' mode.
      geterr, geterrcall, errstate
  
      Notes
      -----
      The floating-point exceptions are defined in the IEEE 754 standard [1]_:
  
      - Division by zero: infinite result obtained from finite numbers.
      - Overflow: result too large to be expressed.
      - Underflow: result so close to zero that some precision
        was lost.
      - Invalid operation: result is not an expressible number, typically
        indicates that a NaN was produced.
  
      .. [1] https://en.wikipedia.org/wiki/IEEE_754
  
      Examples
      --------
      >>> old_settings = np.seterr(all='ignore')  #seterr to known value
      >>> np.seterr(over='raise')
      {'divide': 'ignore', 'over': 'ignore', 'under': 'ignore', 'invalid': 'ignore'}
      >>> np.seterr(**old_settings)  # reset to default
      {'divide': 'ignore', 'over': 'raise', 'under': 'ignore', 'invalid': 'ignore'}
  
      >>> np.int16(32000) * np.int16(3)
      30464
      >>> old_settings = np.seterr(all='warn', over='raise')
      >>> np.int16(32000) * np.int16(3)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      FloatingPointError: overflow encountered in scalar multiply
  
      >>> old_settings = np.seterr(all='print')
      >>> np.geterr()
      {'divide': 'print', 'over': 'print', 'under': 'print', 'invalid': 'print'}
      >>> np.int16(32000) * np.int16(3)
      30464
  
      """
  
      pyvals = umath.geterrobj()
      old = geterr()
  
      if divide is None:
          divide = all or old["divide"]
      if over is None:
          over = all or old["over"]
      if under is None:
          under = all or old["under"]
      if invalid is None:
          invalid = all or old["invalid"]
  
      maskvalue = (
          (_errdict[divide] << SHIFT_DIVIDEBYZERO)
          + (_errdict[over] << SHIFT_OVERFLOW)
          + (_errdict[under] << SHIFT_UNDERFLOW)
          + (_errdict[invalid] << SHIFT_INVALID)
      )
  
      pyvals[1] = maskvalue
      umath.seterrobj(pyvals)
      return old
  
file_path: catboost/contrib/python/numpy/py3/numpy/core/_ufunc_config.py
imports: import collections.abc
  import contextlib
  import contextvars
  from .._utils import set_module
  from .umath import UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE, ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG, ERR_DEFAULT, SHIFT_DIVIDEBYZERO, SHIFT_OVERFLOW, SHIFT_UNDERFLOW, SHIFT_INVALID
  from .None import umath
label_desc: Use image node_id 1 for calling a global function with example usage: seterr(all, divide, over, under, invalid) and returns: old