code: def dist(self, point, exponent=2.0):
          
          point = np.atleast_1d(point)
          if len(point) != self.ndim:
              raise ValueError('`point` must have length {}, got {}'
                               ''.format(self.ndim, len(point)))
  
          if np.any(np.isnan(point)):
              return float('inf')
  
          i_larger = np.where(point > self.max_pt)
          i_smaller = np.where(point < self.min_pt)
  
          # Access [0] since np.where returns a tuple.
          if len(i_larger[0]) == 0 and len(i_smaller[0]) == 0:
              return 0.0
          else:
              proj = np.concatenate((point[i_larger], point[i_smaller]))
              border = np.concatenate((self.max_pt[i_larger],
                                       self.min_pt[i_smaller]))
              return np.linalg.norm(proj - border, ord=exponent)
docs: Return the distance of ``point`` to this set.
  
          Parameters
          ----------
          point : `array-like` or float
              Point whose distance to calculate. Its length must be equal
              to the set's dimension. Can be a float in the 1d case.
          exponent : non-zero float or ``float('inf')``, optional
              Exponent of the norm used in the distance calculation.
  
          Returns
          -------
          dist : float
              Distance to the interior of the IntervalProd.
              Points strictly inside have distance ``0.0``, points with
              ``NaN`` have distance ``float('inf')``.
  
          See Also
          --------
          numpy.linalg.norm : norm used to compute the distance
  
          Examples
          --------
          >>> min_pt, max_pt = [-1, 0, 2], [-0.5, 0, 3]
          >>> rbox = IntervalProd(min_pt, max_pt)
          >>> rbox.dist([-5, 3, 2])
          5.0
          >>> rbox.dist([-5, 3, 2], exponent=float('inf'))
          4.0