def get_unit_by_id(self, unit_id: str) -> typing.Optional['<STR_LIT>']:
VALID_POSITIVE_INT.validate(unit_id, '<STR_LIT>')<EOL>for unit in self.units:<EOL><INDENT>if unit.unit_id == unit_id:<EOL><INDENT>return unit<EOL><DEDENT><DEDENT>return None<EOL>
Gets a unit from its ID

Args:
    unit_id: unit id

Returns: Unit