code: def _redshift(distance, **kwargs):
      r
      cosmology = get_cosmology(**kwargs)
      return z_at_value(cosmology.luminosity_distance, distance, units.Mpc)
docs: r"""Uses astropy to get redshift from the given luminosity distance.
  
      Parameters
      ----------
      distance : float
          The luminosity distance, in Mpc.
      \**kwargs :
          All other keyword args are passed to :py:func:`get_cosmology` to
          select a cosmology. If none provided, will use
          :py:attr:`DEFAULT_COSMOLOGY`.
  
      Returns
      -------
      float :
          The redshift corresponding to the given luminosity distance.