code: def is_unit(value):
      
      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
docs: must be an astropy unit