parameters: (self, arr, context=None)
docstring: Prepare output array for ufunc.
  
        Depending on the context we try to understand if we are doing an
        in-place operation (in which case we want to keep the return value a
        deparray) or we are generating a new array as a result of the ufunc.
        In this case there is no way to know if dependencies should be copied,
        so we strip and return a ndarray.
docstring_summary: Prepare output array for ufunc.
docstring_tokens: Prepare output array for ufunc .
function: def __array_prepare__(self, arr, context=None):
        """Prepare output array for ufunc.
  
        Depending on the context we try to understand if we are doing an
        in-place operation (in which case we want to keep the return value a
        deparray) or we are generating a new array as a result of the ufunc.
        In this case there is no way to know if dependencies should be copied,
        so we strip and return a ndarray.
        """
  
        if context is None or len(context) < 2 or not type(context[0]) is np.ufunc:
           # It is not clear what we should do. If in doubt, strip dependencies.
           return np.ndarray.__array_prepare__(self.view(np.ndarray),arr.view(np.ndarray),context)
        elif len(context[1]) > context[0].nin and context[0].nout > 0:
           # We are being called by a ufunc with a output argument, which is being
           # actually used. Most likely, something like an increment,
           # so we pass on a deparray
           return super(depend_array,self).__array_prepare__(arr,context)
        else:
           # Apparently we are generating a new array.
           # We have no way of knowing its
           # dependencies, so we'd better return a ndarray view!
           return np.ndarray.__array_prepare__(self.view(np.ndarray),arr.view(np.ndarray),context)
function_tokens: def __array_prepare__ ( self , arr , context = None ) : if context is None or len ( context ) < 2 or not type ( context [ 0 ] ) is np . ufunc : # It is not clear what we should do. If in doubt, strip dependencies. return np . ndarray . __array_prepare__ ( self . view ( np . ndarray ) , arr . view ( np . ndarray ) , context ) elif len ( context [ 1 ] ) > context [ 0 ] . nin and context [ 0 ] . nout > 0 : # We are being called by a ufunc with a output argument, which is being # actually used. Most likely, something like an increment, # so we pass on a deparray return super ( depend_array , self ) . __array_prepare__ ( arr , context ) else : # Apparently we are generating a new array. # We have no way of knowing its # dependencies, so we'd better return a ndarray view! return np . ndarray . __array_prepare__ ( self . view ( np . ndarray ) , arr . view ( np . ndarray ) , context )