code: def atleast_nd(n, u):
      
  
      if u.ndim >= n:
          return u
      else:
          return u.reshape(u.shape + (1,)*(n-u.ndim))
docs: If the input array has fewer than n dimensions, append singleton
      dimensions so that it is n dimensional. Note that the interface
      differs substantially from that of :func:`numpy.atleast_3d` etc.
  
      Parameters
      ----------
      n : int
        Minimum number of required dimensions
      u : array_like
        Input array
  
      Returns
      -------
      v : ndarray
        Output array with at least n dimensions