code: def npix_to_nside(npix):
      
  
      npix = np.asanyarray(npix, dtype=np.int64)
  
      if not np.all(npix % 12 == 0):
          raise ValueError('Number of pixels must be divisible by 12')
  
      square_root = np.sqrt(npix / 12)
      if not np.all(square_root ** 2 == npix / 12):
          raise ValueError('Number of pixels is not of the form 12 * nside ** 2')
  
      return np.round(square_root).astype(int)
docs: Find the number of pixels on the side of one of the 12 'top-level' HEALPix
      tiles given a total number of pixels.
  
      Parameters
      ----------
      npix : int
          The number of pixels in the HEALPix map.
  
      Returns
      -------
      nside : int
          The number of pixels on the side of one of the 12 'top-level' HEALPix tiles.