def _LookupIfSimpleCall(self, t):
    'Looks up the type if it has only one method, "__call__".'
    if (not isinstance(t, (pytd.NamedType, pytd.ClassType))):
        return None
    cls = self._MaybeLookup(t)
    if (not isinstance(cls, pytd.Class)):
        return None
    if ([f.name for f in cls.methods] != ['__call__']):
        return None
    (method,) = cls.methods
    return (cls if all((self._HasSelf(sig) for sig in method.signatures)) else None)
Looks up the type if it has only one method, "__call__".
def _LookupIfSimpleCall(self, t):
    
    if (not isinstance(t, (pytd.NamedType, pytd.ClassType))):
        return None
    cls = self._MaybeLookup(t)
    if (not isinstance(cls, pytd.Class)):
        return None
    if ([f.name for f in cls.methods] != ['__call__']):
        return None
    (method,) = cls.methods
    return (cls if all((self._HasSelf(sig) for sig in method.signatures)) else None)