parameters: (self, obj, context=None)
return_statement: return result
docstring: Special hook for ufuncs.
          Wraps the numpy array and sets the mask according to context.
docstring_summary: Special hook for ufuncs.
          Wraps the numpy array and sets the mask according to context.
docstring_tokens: Special hook for ufuncs . Wraps the numpy array and sets the mask according to context .
function: def __array_wrap__(self, obj, context=None):
          """
          Special hook for ufuncs.
          Wraps the numpy array and sets the mask according to context.
          """
          result = obj.view(type(self))
          result._update_from(self)
          #..........
          if context is not None:
              result._mask = result._mask.copy()
              (func, args, _) = context
              m = reduce(mask_or, [getmaskarray(arg) for arg in args])
              # Get the domain mask................
              domain = ufunc_domain.get(func, None)
              if domain is not None:
                  # Take the domain, and make sure it's a ndarray
                  if len(args) > 2:
                      d = filled(reduce(domain, args), True)
                  else:
                      d = filled(domain(*args), True)
                  # Fill the result where the domain is wrong
                  try:
                      # Binary domain: take the last value
                      fill_value = ufunc_fills[func][-1]
                  except TypeError:
                      # Unary domain: just use this one
                      fill_value = ufunc_fills[func]
                  except KeyError:
                      # Domain not recognized, use fill_value instead
                      fill_value = self.fill_value
                  result = result.copy()
                  np.copyto(result, fill_value, where=d)
                  # Update the mask
                  if m is nomask:
                      if d is not nomask:
                          m = d
                  else:
                      # Don't modify inplace, we risk back-propagation
                      m = (m | d)
              # Make sure the mask has the proper size
              if result.shape == () and m:
                  return masked
              else:
                  result._mask = m
                  result._sharedmask = False
          #....
          return result
function_tokens: def __array_wrap__ ( self , obj , context = None ) : result = obj . view ( type ( self ) ) result . _update_from ( self ) #.......... if context is not None : result . _mask = result . _mask . copy ( ) ( func , args , _ ) = context m = reduce ( mask_or , [ getmaskarray ( arg ) for arg in args ] ) # Get the domain mask................ domain = ufunc_domain . get ( func , None ) if domain is not None : # Take the domain, and make sure it's a ndarray if len ( args ) > 2 : d = filled ( reduce ( domain , args ) , True ) else : d = filled ( domain ( * args ) , True ) # Fill the result where the domain is wrong try : # Binary domain: take the last value fill_value = ufunc_fills [ func ] [ - 1 ] except TypeError : # Unary domain: just use this one fill_value = ufunc_fills [ func ] except KeyError : # Domain not recognized, use fill_value instead fill_value = self . fill_value result = result . copy ( ) np . copyto ( result , fill_value , where = d ) # Update the mask if m is nomask : if d is not nomask : m = d else : # Don't modify inplace, we risk back-propagation m = ( m | d ) # Make sure the mask has the proper size if result . shape == ( ) and m : return masked else : result . _mask = m result . _sharedmask = False #.... return result