code: def nan_to_num(x, copy=True):
      """
      Replace NaN with zero and infinity with large finite numbers.
  
      If `x` is inexact, NaN is replaced by zero, and infinity and -infinity
      replaced by the respectively largest and most negative finite floating
      point values representable by ``x.dtype``.
  
      For complex dtypes, the above is applied to each of the real and
      imaginary components of `x` separately.
  
      If `x` is not inexact, then no replacements are made.
  
      Parameters
      ----------
      x : scalar or array_like
          Input data.
      copy : bool, optional
          Whether to create a copy of `x` (True) or to replace values
          in-place (False). The in-place operation only occurs if
          casting to an array does not require a copy.
          Default is True.
  
          .. versionadded:: 1.13
  
      Returns
      -------
      out : ndarray
          `x`, with the non-finite values replaced. If `copy` is False, this may
          be `x` itself.
  
      See Also
      --------
      isinf : Shows which elements are positive or negative infinity.
      isneginf : Shows which elements are negative infinity.
      isposinf : Shows which elements are positive infinity.
      isnan : Shows which elements are Not a Number (NaN).
      isfinite : Shows which elements are finite (not NaN, not infinity)
  
      Notes
      -----
      NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
      (IEEE 754). This means that Not a Number is not equivalent to infinity.
  
      Examples
      --------
      >>> np.nan_to_num(np.inf)
      1.7976931348623157e+308
      >>> np.nan_to_num(-np.inf)
      -1.7976931348623157e+308
      >>> np.nan_to_num(np.nan)
      0.0
      >>> x = np.array([np.inf, -np.inf, np.nan, -128, 128])
      >>> np.nan_to_num(x)
      array([  1.79769313e+308,  -1.79769313e+308,   0.00000000e+000,
              -1.28000000e+002,   1.28000000e+002])
      >>> y = np.array([complex(np.inf, np.nan), np.nan, complex(np.nan, np.inf)])
      >>> np.nan_to_num(y)
      array([  1.79769313e+308 +0.00000000e+000j,
               0.00000000e+000 +0.00000000e+000j,
               0.00000000e+000 +1.79769313e+308j])
      """
      x = _nx.array(x, subok=True, copy=copy)
      xtype = x.dtype.type
  
      isscalar = x.ndim == 0
  
      if not issubclass(xtype, _nx.inexact):
          return x[()] if isscalar else x
  
      iscomplex = issubclass(xtype, _nx.complexfloating)
  
      dest = (x.real, x.imag) if iscomplex else (x,)
      maxf, minf = _getmaxmin(x.real.dtype)
      for d in dest:
          _nx.copyto(d, 0.0, where=isnan(d))
          _nx.copyto(d, maxf, where=isposinf(d))
          _nx.copyto(d, minf, where=isneginf(d))
      return x[()] if isscalar else x
  
imports: from __future__ import division, absolute_import, print_function
  import functools
  import warnings
  import numpy.core.numeric
  from numpy.core.numeric import asarray, asanyarray, isnan, zeros
  from numpy.core.overrides import set_module
  from numpy.core import overrides
  from .ufunclike import isneginf, isposinf
label_desc: Use image node_id 15 for calling a global function with example usage: nan_to_num(x, copy) and returns: unknown, unknown