class CountFunc(ast.NodeVisitor):
    func_count = 0

def visit_ClassDef(self, node):
    return

def visit_FunctionDef(self, node):
    self.func_count += 1

def visit_Lambda(self, node):
    self.func_count += 1
Good way to count number of functions of a python file, given path