return flattened data ``(x, f)`` such that for the sweep through
        coordinate ``i`` we have for data point ``j`` that ``f[i][j] == func(x[i][j])``
327883
def flattened(self):
        
        flatx = {}
        flatf = {}
        for i in self.res:
            if isinstance(i, int):
                flatx[i] = []
                flatf[i] = []
                for x in sorted(self.res[i]):
                    for d in sorted(self.res[i][x]):
                        flatx[i].append(x)
                        flatf[i].append(d)
        return flatx, flatf
207084
def slice_transform(func, self, X, *vargs, **kwargs):
    
    X = X if self.apply_ind is None else X[:, self.apply_ind]
    return func(self, X, *vargs, **kwargs)
185338
def _wrap_in_place(func):  # noqa: D202
        """"""

        @wraps(func)
        def wrapper(graph, *args, **kwargs):
            """Apply the enclosed function and returns the graph."""
            func(graph, *args, **kwargs)
            return graph

        return wrapper
1065897
def n_func(self):
        '''
        
        '''
        return interpolate.interp2d(self.x, self.y, self.n)
966653
def ricker(f, length, dt):
    
    t = np.linspace(-int(length/2), int((length-dt)/2), int(length/dt))
    y = (1. - 2.*(np.pi**2)*(f**2)*(t**2))*np.exp(-(np.pi**2)*(f**2)*(t**2))
    return t, y
1295670
def _reshape_like(F, x, y):
    """"""
    return x.reshape(y.shape) if F is ndarray else F.reshape_like(x, y)
578969
def _call(self, x):
        """"""
        out = x.asarray().ravel()[self._indices_flat]

        if self.variant == 'point_eval':
            weights = 1.0
        elif self.variant == 'integrate':
            weights = getattr(self.domain, 'cell_volume', 1.0)
        else:
            raise RuntimeError('bad variant {!r}'.format(self.variant))

        if weights != 1.0:
            out *= weights

        return out
231689
function (obj, f) {
      return tupleMap(obj, function (x, i, obj) {
        return {
          k: i,
          v: f(x, i, obj)
        };
      });
    }
292810
def F_(self, X):
        
        if self._interpol:
            if not hasattr(self, '_F_interp'):

                if self._lookup:
                    x = self._x_lookup
                    F_x = self._f_lookup
                else:
                    x = np.linspace(0, self._max_interp_X, self._num_interp_X)
                    F_x = self._F(x)
                self._F_interp = interp.interp1d(x, F_x, kind='linear', axis=-1, copy=False, bounds_error=False,
                                                 fill_value=0, assume_sorted=True)
            return self._F_interp(X)
        else:
            return self._F(X)
821390
def map_stack(array3D, z_function):
    
    _, _, zdim = array3D.shape
    return np.dstack([z_function(array3D[:,:,z]) for z in range(zdim)])
755223
def f(x, a, c):
    
    v = g(x, a, c)
    return v.dot(v)
447271
def cos(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_cos,
        (BigFloat._implicit_convert(x),),
        context,
    )
736592
def j0(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_j0,
        (BigFloat._implicit_convert(x),),
        context,
    )
1050792
def _(f, x):
    
    return {k: v for k, v in x.items() if f(k, v)}
1160800
def _call(self, x, out=None):
        """"""
        if out is None:
            return self.vector * self.functional(x)
        else:
            scalar = self.functional(x)
            out.lincomb(scalar, self.vector)
226396
def obj(x):
    """"""
    
    j = np.arange(1, 6)
    tmp1 = np.dot(j, np.cos((j+1)*x[0] + j))
    tmp2 = np.dot(j, np.cos((j+1)*x[1] + j))
    return tmp1 * tmp2
781166
def SpiceUDSTEP(f):
    

    @functools.wraps(f)
    def wrapping_udstep(x, value):
        result = f(x)
        value[0] = c_double(result)

    return UDSTEP(wrapping_udstep)