def _MaybeLookup(self, t):
    if isinstance(t, pytd.NamedType):
        try:
            return self._module.Lookup(t.name)
        except KeyError:
            return None
    elif isinstance(t, pytd.ClassType):
        return t.cls
    else:
        return None
def _MaybeLookup(self, t):
    if isinstance(t, pytd.NamedType):
        try:
            return self._module.Lookup(t.name)
        except KeyError:
            return None
    elif isinstance(t, pytd.ClassType):
        return t.cls
    else:
        return None