docs: def in_units(self, units, equivalence=None, **kwargs):
          """
          Creates a copy of this array with the data converted to the
          supplied units, and returns it.
  
          Optionally, an equivalence can be specified to convert to an
          equivalent quantity which is not in the same dimensions.
  
          Parameters
          ----------
          units : Unit object or string
              The units you want to get a new quantity in.
          equivalence : string, optional
              The equivalence you wish to use. To see which equivalencies
              are supported for this object, try the ``list_equivalencies``
              method. Default: None
          kwargs: optional
              Any additional keyword arguments are supplied to the
              equivalence
  
          Raises
          ------
          If the provided unit does not have the same dimensions as the array
          this will raise a UnitConversionError
  
          Examples
          --------
          >>> from unyt import c, gram
          >>> m = 10*gram
          >>> E = m*c**2
          >>> print(E.in_units('erg'))
          8.987551787368176e+21 erg
          >>> print(E.in_units('J'))
          898755178736817.6 J
          """
          units = _sanitize_units_convert(units, self.units.registry)
          if equivalence is None:
              conv_data = _check_em_conversion(
                  self.units, units, registry=self.units.registry
              )
              if any(conv_data):
                  new_units, (conversion_factor, offset) = _em_conversion(
                      self.units, conv_data, units
                  )
                  offset = 0
              else:
                  new_units = units
                  (conversion_factor, offset) = self.units.get_conversion_factor(
                      new_units, self.dtype
                  )
              dsize = self.dtype.itemsize
              if self.dtype.kind in ("u", "i"):
                  large = LARGE_INPUT.get(dsize, 0)
                  if large and np.any(np.abs(self.d) > large):
                      warnings.warn(
                          "Overflow encountered while converting to units '%s'"
                          % new_units,
                          RuntimeWarning,
                          stacklevel=2,
                      )
              new_dtype = np.dtype("f" + str(dsize))
              conversion_factor = new_dtype.type(conversion_factor)
              ret = np.asarray(self.ndview * conversion_factor, dtype=new_dtype)
              if offset:
                  np.subtract(ret, offset, ret)
  
              new_array = type(self)(ret, new_units, bypass_validation=True)
  
              return new_array
          else:
              return self.to_equivalent(units, equivalence, **kwargs)