def is_unit_acceptable(self, unit, raise_exception=True):
_is_acceptable = unit in self.units<EOL>if _is_acceptable or raise_exception is False:<EOL><INDENT>return _is_acceptable<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>unit, self.__class__.__name__, self.units<EOL>)<EOL>)<EOL><DEDENT>
Check if a certain unit is acceptable for the data type.

        Args:
            unit: A text string representing the abbreviated unit.
            raise_exception: Set to True to raise an exception if not acceptable.