<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_group_by_id(self, group_id: str) -> typing.Optional['Group']: """ Gets a group by id Args: group_id: group id Returns: Group """

        VALID_POSITIVE_INT.validate(group_id, 'get_group_by_id', exc=ValueError)
        for group in self.groups:

            if group.group_id == group_id:
                return group
        return None