<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_unit(value):
 """must be an astropy unit"""

    if not _has_astropy:
        raise ImportError("astropy must be installed for unit support")
    if (isinstance(value, units.Unit) or isinstance(value, units.IrreducibleUnit) or isinstance(value, units.CompositeUnit)):
        return True, value
    else:
        return False, value