<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getContact(self, user=None, channel=None):
 """ get a Contact instance for ``user`` on ``channel`` """

        try:
            return self.contacts[(channel, user)]
        except KeyError:
            new_contact = self.contactClass(self, user=user, channel=channel)
            self.contacts[(channel, user)] = new_contact
            new_contact.setServiceParent(self)
            return new_contact