Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_contact(self, ref):
""" return Contact object (create one if needed) for the specified 'ref'.
ref can be a Contact, email address string or contact id.
"""
if isinstance(ref, str):
return self.account.create_contact(ref)
elif isinstance(ref, int):
return self.account.get_contact_by_id(ref)
elif isinstance(ref, Contact):
return ref