<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addLeadingToGroups(self, proteinIds, groupIds):
 """Add one or multiple leading proteins to one or multiple protein groups. :param proteinIds: a proteinId or a list of proteinIds, a proteinId must be a string. :param groupIds: a groupId or a list of groupIds, a groupId must be a string. """

        for groupId in AUX.toList(groupIds):
            self.groups[groupId].addLeadingProteins(proteinIds)
            self._addProteinIdsToGroupMapping(proteinIds, groupId)