def identify_unit_framework(target_unit):
if HAS_ASTROPY:<EOL><INDENT>from astropy.units import UnitBase<EOL>if isinstance(target_unit, UnitBase):<EOL><INDENT>return ASTROPY<EOL><DEDENT><DEDENT>if HAS_PINT:<EOL><INDENT>from pint.unit import UnitsContainer<EOL>if hasattr(target_unit, '<STR_LIT>') and isinstance(target_unit.dimensionality, UnitsContainer):<EOL><INDENT>return PINT<EOL><DEDENT><DEDENT>if HAS_QUANTITIES:<EOL><INDENT>from quantities.unitquantity import IrreducibleUnit<EOL>from quantities import Quantity<EOL>if isinstance(target_unit, IrreducibleUnit) or isinstance(target_unit, Quantity):<EOL><INDENT>return QUANTITIES<EOL><DEDENT><DEDENT>raise TraitError("<STR_LIT>".format(type(target_unit).__name__))<EOL>
Identify whether the user is requesting unit validation against
astropy.units, pint, or quantities.