<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unit(self, name: Optional[UnitName] = None, symbol=False):
 """Get unit name. :param name: Enum object UnitName. :param symbol: Return only symbol :return: Unit. """

        result = self._validate_enum(item=name, enum=UnitName)

        if symbol:
            return result[1]
        return result[0]