<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def contact_get_common_groups(self, contact_id):
 """ Returns groups common between a user and the contact with given id. :return: Contact or Error :rtype: Contact """

        for group in self.wapi_functions.getCommonGroups(contact_id):
            yield factory_chat(group, self)