def METHOD_NAME(self, id, idx):
    key = id
    if key in self.types:
        return self.types[key][idx]
    key = self.namespace.ns + id
    if key in self.types:
        return self.types[key][idx]
    for key in self.types.keys():
        if key.rpartition(':')[2] == id:
            return self.types[key][idx]
    raise ResolveException('Type %s not found' % id)