<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_type(self, name, api=None):
 """Returns Type `name`, with preference for the Type of `api`. :param str name: Type name :param str api: api name to prefer, of None to prefer types with no api name :return: Type object """

        k = (name, api)
        if k in self.types:
            return self.types[k]
        else:
            return self.types[(name, None)]