parameters: (a, b, masked_equal=True, rtol=1e-5, atol=1e-8)
return_statement: return np.all(d)
docstring: Returns True if two arrays are element-wise equal within a tolerance.
  
      This function is equivalent to `allclose` except that masked values
      are treated as equal (default) or unequal, depending on the `masked_equal`
      argument.
  
      Parameters
      ----------
      a, b : array_like
          Input arrays to compare.
      masked_equal : bool, optional
          Whether masked values in `a` and `b` are considered equal (True) or not
          (False). They are considered equal by default.
      rtol : float, optional
          Relative tolerance. The relative difference is equal to ``rtol * b``.
          Default is 1e-5.
      atol : float, optional
          Absolute tolerance. The absolute difference is equal to `atol`.
          Default is 1e-8.
  
      Returns
      -------
      y : bool
          Returns True if the two arrays are equal within the given
          tolerance, False otherwise. If either array contains NaN, then
          False is returned.
  
      See Also
      --------
      all, any
      numpy.allclose : the non-masked `allclose`.
  
      Notes
      -----
      If the following equation is element-wise True, then `allclose` returns
      True::
  
        absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))
  
      Return True if all elements of `a` and `b` are equal subject to
      given tolerances.
  
      Examples
      --------
      >>> a = ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])
      >>> a
      masked_array(data = [10000000000.0 1e-07 --],
                   mask = [False False  True],
             fill_value = 1e+20)
      >>> b = ma.array([1e10, 1e-8, -42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      False
  
      >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
      >>> b = ma.array([1.00001e10, 1e-9, -42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      True
      >>> ma.allclose(a, b, masked_equal=False)
      False
  
      Masked values are not compared directly.
  
      >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
      >>> b = ma.array([1.00001e10, 1e-9, 42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      True
      >>> ma.allclose(a, b, masked_equal=False)
      False
docstring_summary: Returns True if two arrays are element-wise equal within a tolerance.
docstring_tokens: Returns True if two arrays are element - wise equal within a tolerance .
function: def allclose(a, b, masked_equal=True, rtol=1e-5, atol=1e-8):
      """
      Returns True if two arrays are element-wise equal within a tolerance.
  
      This function is equivalent to `allclose` except that masked values
      are treated as equal (default) or unequal, depending on the `masked_equal`
      argument.
  
      Parameters
      ----------
      a, b : array_like
          Input arrays to compare.
      masked_equal : bool, optional
          Whether masked values in `a` and `b` are considered equal (True) or not
          (False). They are considered equal by default.
      rtol : float, optional
          Relative tolerance. The relative difference is equal to ``rtol * b``.
          Default is 1e-5.
      atol : float, optional
          Absolute tolerance. The absolute difference is equal to `atol`.
          Default is 1e-8.
  
      Returns
      -------
      y : bool
          Returns True if the two arrays are equal within the given
          tolerance, False otherwise. If either array contains NaN, then
          False is returned.
  
      See Also
      --------
      all, any
      numpy.allclose : the non-masked `allclose`.
  
      Notes
      -----
      If the following equation is element-wise True, then `allclose` returns
      True::
  
        absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))
  
      Return True if all elements of `a` and `b` are equal subject to
      given tolerances.
  
      Examples
      --------
      >>> a = ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])
      >>> a
      masked_array(data = [10000000000.0 1e-07 --],
                   mask = [False False  True],
             fill_value = 1e+20)
      >>> b = ma.array([1e10, 1e-8, -42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      False
  
      >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
      >>> b = ma.array([1.00001e10, 1e-9, -42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      True
      >>> ma.allclose(a, b, masked_equal=False)
      False
  
      Masked values are not compared directly.
  
      >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
      >>> b = ma.array([1.00001e10, 1e-9, 42.0], mask=[0, 0, 1])
      >>> ma.allclose(a, b)
      True
      >>> ma.allclose(a, b, masked_equal=False)
      False
  
      """
      x = masked_array(a, copy=False)
      y = masked_array(b, copy=False)
  
      # make sure y is an inexact type to avoid abs(MIN_INT); will cause
      # casting of x later.
      dtype = np.result_type(y, 1.)
      if y.dtype != dtype:
          y = masked_array(y, dtype=dtype, copy=False)
  
      m = mask_or(getmask(x), getmask(y))
      xinf = np.isinf(masked_array(x, copy=False, mask=m)).filled(False)
      # If we have some infs, they should fall at the same place.
      if not np.all(xinf == filled(np.isinf(y), False)):
          return False
      # No infs at all
      if not np.any(xinf):
          d = filled(less_equal(absolute(x - y), atol + rtol * absolute(y)),
                     masked_equal)
          return np.all(d)
  
      if not np.all(filled(x[xinf] == y[xinf], masked_equal)):
          return False
      x = x[~xinf]
      y = y[~xinf]
  
      d = filled(less_equal(absolute(x - y), atol + rtol * absolute(y)),
                 masked_equal)
  
      return np.all(d)
function_tokens: def allclose ( a , b , masked_equal = True , rtol = 1e-5 , atol = 1e-8 ) : x = masked_array ( a , copy = False ) y = masked_array ( b , copy = False ) # make sure y is an inexact type to avoid abs(MIN_INT); will cause # casting of x later. dtype = np . result_type ( y , 1. ) if y . dtype != dtype : y = masked_array ( y , dtype = dtype , copy = False ) m = mask_or ( getmask ( x ) , getmask ( y ) ) xinf = np . isinf ( masked_array ( x , copy = False , mask = m ) ) . filled ( False ) # If we have some infs, they should fall at the same place. if not np . all ( xinf == filled ( np . isinf ( y ) , False ) ) : return False # No infs at all if not np . any ( xinf ) : d = filled ( less_equal ( absolute ( x - y ) , atol + rtol * absolute ( y ) ) , masked_equal ) return np . all ( d ) if not np . all ( filled ( x [ xinf ] == y [ xinf ] , masked_equal ) ) : return False x = x [ ~ xinf ] y = y [ ~ xinf ] d = filled ( less_equal ( absolute ( x - y ) , atol + rtol * absolute ( y ) ) , masked_equal ) return np . all ( d )