def __pow__(self, shape):
        """Return ``self ** shape``.

        Notes
        -----
        This can be overridden by subclasses in order to give better memory
        coherence or otherwise a better interface.

        Examples
        --------
        Create simple power space:

        >>> r2 = odl.rn(2)
        >>> r2 ** 4
        ProductSpace(rn(2), 4)

        Multiple powers work as expected:

        >>> r2 ** (4, 2)
        ProductSpace(ProductSpace(rn(2), 4), 2)
        """
        from odl.space import ProductSpace

        try:
            shape = (int(shape),)
        except TypeError:
            shape = tuple(shape)

        pspace = self
        for n in shape:
            pspace = ProductSpace(pspace, n)

        return pspace
def __pow__ ( self , shape ) : from odl . space import ProductSpace try : shape = ( int ( shape ) , ) except TypeError : shape = tuple ( shape ) pspace = self for n in shape : pspace = ProductSpace ( pspace , n ) return pspace
Return ``self ** shape``.

        Notes
        -----
        This can be overridden by subclasses in order to give better memory
        coherence or otherwise a better interface.

        Examples
        --------
        Create simple power space:

        >>> r2 = odl.rn(2)
        >>> r2 ** 4
        ProductSpace(rn(2), 4)

        Multiple powers work as expected:

        >>> r2 ** (4, 2)
        ProductSpace(ProductSpace(rn(2), 4), 2)