code: def to_pint(self, unit_registry=None):
          
          if unit_registry is None:
              unit_registry = _pint.UnitRegistry()
          powers_dict = self.units.expr.as_powers_dict()
          units = []
          for unit, pow in powers_dict.items():
              # we have to do this because Pint doesn't recognize
              # "yr" as "year"
              if str(unit).endswith("yr") and len(str(unit)) in [2, 3]:
                  unit = str(unit).replace("yr", "year")
              units.append("%s**(%s)" % (unit, Rational(pow)))
          units = "*".join(units)
          return unit_registry.Quantity(self.value, units)
docs: Convert a unyt_array or unyt_quantity to a Pint Quantity.
  
          Parameters
          ----------
          arr : unyt_array or unyt_quantity
              The unitful quantity to convert from.
          unit_registry : Pint UnitRegistry, optional
              The Pint UnitRegistry to use in the conversion. If one is not
              supplied, the default one will be used. NOTE: This is not
              the same as a yt UnitRegistry object.
  
          Examples
          --------
          >>> from unyt import cm, s
          >>> a = 4*cm**2/s
          >>> print(a)
          4 cm**2/s
          >>> a.to_pint()
          <Quantity(4, 'centimeter ** 2 / second')>