<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_unit_by_id(self, unit_id: str) -> typing.Optional['BaseUnit']: """ Gets a unit from its ID Args: unit_id: unit id Returns: Unit """

        VALID_POSITIVE_INT.validate(unit_id, 'get_unit_by_id')
        for unit in self.units:

            if unit.unit_id == unit_id:
                return unit
        return None