code: def separable_approx(h, N=1):
      
      if h.ndim == 2:
          return _separable_approx2(h, N)
      elif h.ndim == 3:
          return _separable_approx3(h, N)
      else:
          raise ValueError("unsupported array dimension: %s (only 2d or 3d) " % h.ndim)
docs: finds the k-th rank approximation to h, where k = 1..N
  
      similar to separable_series
  
      Parameters
      ----------
      h: ndarray
          input array (2 or 2 dimensional)
      N: int
          order of approximation
  
      Returns
      -------
          all N apprxoimations res[i], the i-th approximation