'Return the converted values in the specified unit.
Parameters
other : `~astropy.units.Unit` object, `~astropy.units.function.FunctionUnitBase` object or string
The unit to convert to.
value : scalar int or float, or sequence convertible to array, optional
Value(s) in the current unit to be converted to the specified unit.
If not provided, defaults to 1.0.
equivalencies : list of equivalence pairs, optional
A list of equivalence pairs to try if the units are not
directly convertible.  See :ref:`unit_equivalencies`.
This list is in meant to treat only equivalencies between different
physical units; the build-in equivalency between the function
unit and the physical one is automatically taken into account.
Returns
values : scalar or array
Converted value(s). Input value sequences are returned as
numpy arrays.
Raises
UnitsError
If units are inconsistent.'

def to(self, other, value=1.0, equivalencies=[]):

    if (other is self.physical_unit):
        return self.to_physical(value)
    other_function_unit = getattr(other, u'function_unit', other)
    if self.function_unit.is_equivalent(other_function_unit):
        other_physical_unit = getattr(other, u'physical_unit', dimensionless_unscaled)
        if (self.physical_unit != other_physical_unit):
            value_other_physical = self.physical_unit.to(other_physical_unit, self.to_physical(value), equivalencies)
            value = self.from_physical(value_other_physical)
        return self.function_unit.to(other_function_unit, value)
    else:
        return self.physical_unit.to(other, self.to_physical(value), equivalencies)
