def _return_quantity(quantity, return_quantity, units_out=''):
    """Helper method to return appropriate unit type
    Parameters
    ----------
        quantity : :class:`~vunits.quantity.Quantity` obj
            Quantity object to use
        return_quantity : bool
            If True, returns :class:`~vunits.quantity.Quantity` obj. Otherwise,
            return ``quantity.mag``
        units_out : str, optional
            Units to return. Not required if ``return_quantity`` is True.
    Returns
    -------
        out : :class:`~vunits.quantity.Quantity` obj or float
            Value to return based on ``return_quantity``.
    """
    if return_quantity:
        return quantity
    else:
        return quantity(units_out)