code: def boundaries(nside, pix, step=1, nest=False):
      
      pix = np.asarray(pix)
      if pix.ndim > 1:
          # For consistency with healpy we only support scalars or 1D arrays
          raise ValueError("Array has to be one dimensional")
      lon, lat = boundaries_lonlat(pix, step, nside, order='nested' if nest else 'ring')
      rep_sph = UnitSphericalRepresentation(lon, lat)
      rep_car = rep_sph.to_cartesian().xyz.value.swapaxes(0, 1)
      if rep_car.shape[0] == 1:
          return rep_car[0]
      else:
          return rep_car
docs: Drop-in replacement for healpy `~healpy.boundaries`.