code: def get_unit_by_id(self, unit_id: str) -> typing.Optional['BaseUnit']:
          
          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
docs: Gets a unit from its ID
  
          Args:
              unit_id: unit id
  
          Returns: Unit