<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def surface_measure(self, param):
 """Density function of the surface measure. This is the default implementation relying on the `surface_deriv` method. For a detector with `ndim` equal to 1, the density is given by the `Arc length`_, for a surface with `ndim` 2 in a 3D space, it is the length of the cross product of the partial derivatives of the parametrization, see Wikipedia's `Surface area`_ article. Parameters param : `array-like` or sequence Parameter value(s) at which to evaluate. If ``ndim >= 2``, a sequence of length `ndim` must be provided. Returns ------- measure : float or `numpy.ndarray` The density value(s) at the given parameter(s). If a single parameter is provided, a float is returned. Otherwise, an array is returned with shape - ``param.shape`` if `ndim` is 1, - ``broadcast(*param).shape`` otherwise. References .. _Arc length: https://en.wikipedia.org/wiki/Curve#Lengths_of_curves .. _Surface area: https://en.wikipedia.org/wiki/Surface_area """

        # Checking is done by `surface_deriv`
        if self.ndim == 1:
            scalar_out = (np.shape(param) == ())
            measure = np.linalg.norm(self.surface_deriv(param), axis=-1)
            if scalar_out:
                measure = float(measure)

            return measure

        elif self.ndim == 2 and self.space_ndim == 3:
            scalar_out = (np.shape(param) == (2,))
            deriv = self.surface_deriv(param)
            if deriv.ndim > 2:
                # Vectorized, need to reshape (N, 2, 3) to (2, N, 3)
                deriv = moveaxis(deriv, -2, 0)
            cross = np.cross(*deriv, axis=-1)
            measure = np.linalg.norm(cross, axis=-1)
            if scalar_out:
                measure = float(measure)

            return measure

        else:
            raise NotImplementedError(
                'no default implementation of `surface_measure` available '
                'for `ndim={}` and `space_ndim={}`'
                ''.format(self.ndim, self.space_ndim))