def VisitClass(self, cls):
    'Visit a class, and change constants to methods where possible.'
    new_constants = []
    new_methods = list(cls.methods)
    adjust_self = visitors.AdjustSelf(force=True)
    adjust_self.class_types.append(visitors.ClassAsType(cls))
    for const in cls.constants:
        c = self._LookupIfSimpleCall(const.type)
        if c:
            signatures = c.methods[0].signatures
            self._processed_count[c.name] += 1
            new_method = pytd.Function(const.name, signatures, c.methods[0].kind)
            new_methods.append(new_method.Visit(adjust_self))
        else:
            new_constants.append(const)
    return cls.Replace(constants=tuple(new_constants), methods=tuple(new_methods))
Visit a class, and change constants to methods where possible.
def VisitClass(self, cls):
    
    new_constants = []
    new_methods = list(cls.methods)
    adjust_self = visitors.AdjustSelf(force=True)
    adjust_self.class_types.append(visitors.ClassAsType(cls))
    for const in cls.constants:
        c = self._LookupIfSimpleCall(const.type)
        if c:
            signatures = c.methods[0].signatures
            self._processed_count[c.name] += 1
            new_method = pytd.Function(const.name, signatures, c.methods[0].kind)
            new_methods.append(new_method.Visit(adjust_self))
        else:
            new_constants.append(const)
    return cls.Replace(constants=tuple(new_constants), methods=tuple(new_methods))