code: def submarine(space, smooth=True, taper=20.0):
      
      if space.ndim == 2:
          if smooth:
              return _submarine_2d_smooth(space, taper)
          else:
              return _submarine_2d_nonsmooth(space)
      else:
          raise ValueError('phantom only defined in 2 dimensions, got {}'
                           ''.format(space.ndim))
docs: Return a 'submarine' phantom consisting in an ellipsoid and a box.
  
      Parameters
      ----------
      space : `DiscreteLp`
          Discretized space in which the phantom is supposed to be created.
      smooth : bool, optional
          If ``True``, the boundaries are smoothed out. Otherwise, the
          function steps from 0 to 1 at the boundaries.
      taper : float, optional
          Tapering parameter for the boundary smoothing. Larger values
          mean faster taper, i.e. sharper boundaries.
  
      Returns
      -------
      phantom : ``space`` element
          The submarine phantom in ``space``.