'Check that the ufunc can deal with a FunctionQuantity.'

def __array_prepare__(self, obj, context=None):

    if (context is None):
        return obj
    function = context[0]
    if (not ((function in self._supported_ufuncs) or all(((arg.unit.physical_unit == dimensionless_unscaled) for arg in context[1][:function.nin] if (hasattr(arg, u'unit') and hasattr(arg.unit, u'physical_unit')))))):
        raise UnitTypeError(u"Cannot    use    function    '{0}'    with    function    quantities    that    are    not    dimensionless.".format(context[0].__name__))
    return super(FunctionQuantity, self).__array_prepare__(obj, context)
