Module ImportFrom alias Import alias Import alias Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Return BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd Call AttributeLoad NameLoad attr Str UnaryOpNot CompareIn Str Call AttributeLoad NameLoad attr BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str CompareIn Str NameLoad CompareIn Str NameLoad CompareIn Str NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListLoad While CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Assign NameStore BinOpMult Str NameLoad FunctionDef arguments args NameParam defaults body Return BoolOpAnd CompareNotEq NameLoad Str UnaryOpNot Call AttributeLoad NameLoad attr NameLoad UnaryOpNot Call AttributeLoad NameLoad attr Str decorator_list Assign NameStore AttributeLoad NameLoad attr While CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return AugAssignAdd AttributeStore NameLoad attr Num If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr keyword BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body Expr Call NameLoad While BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore ListLoad Assign NameStore NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If BoolOpAnd NameLoad Call NameLoad NameLoad body Assign NameStore NameLoad Continue If Call AttributeLoad NameLoad attr Str body Continue If Call NameLoad NameLoad body Assign NameStore NameLoad Continue Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Num While Call AttributeLoad NameLoad attr BinOpMult Str NameLoad body AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad Call NameLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr decorator_list Assign NameStore Str Assign NameStore ListLoad Num Num Num Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assert CompareEq NameLoad NameLoad FunctionDef arguments args defaults body For TupleStore NameStore NameStore NameStore NameLoad body Expr Call NameLoad NameLoad For NameStore NameLoad body If UnaryOpNot Call NameLoad NameLoad body Continue Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad Call NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Dict Str Str Str NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Dict For TupleStore NameStore NameStore NameStore NameLoad body Expr Call NameLoad NameLoad For NameStore NameLoad body If BoolOpOr UnaryOpNot Call NameLoad NameLoad Call AttributeLoad NameLoad attr Str body Continue Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad CompareGt NameLoad Num attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Num BinOpMod Str BinOpDiv BinOpSub NameLoad NameLoad Call NameLoad NameLoad keyword Num Expr Call AttributeLoad NameLoad attr
N/A __future__ print_function N/A os N/A sys N/A numpy np N/A matplotlib.pyplot plt pandas DataFrame pandas.util.testing set_trace pandas compat N/A dirs N/A N/A names N/A N/A lengths N/A N/A N/A N/A len N/A sys argv 1 N/A N/A loc N/A N/A sys argv N/A 1 N/A N/A loc . N/A walked N/A N/A os walk loc _should_count_file N/A N/A path N/A N/A N/A N/A N/A N/A path endswith .py N/A N/A path endswith .pyx N/A _is_def_line N/A N/A line N/A N/A N/A def/cdef/cpdef, but not `cdef class` N/A N/A N/A N/A line endswith : N/A N/A class N/A N/A line split N/A N/A N/A line startswith def  N/A N/A line startswith cdef  N/A N/A line startswith cpdef  N/A  def  line N/A  cdef  line N/A  cpdef  line N/A LengthCounter N/A object N/A N/A 
    should add option for subtracting nested function lengths??
     __init__ N/A N/A self lines N/A N/A N/A N/A self lines lines N/A N/A self pos 0 N/A N/A self counts N/A N/A N/A self n N/A len lines N/A get_counts N/A N/A self N/A N/A N/A N/A self pos 0 N/A N/A self counts N/A N/A N/A N/A self pos N/A self n N/A N/A line N/A N/A self lines N/A N/A self pos N/A N/A self pos 1 N/A N/A _is_def_line line N/A N/A level N/A _get_indent_level line N/A N/A N/A self _count_function indent_level level N/A N/A self counts N/A _count_function N/A N/A self indent_level N/A 1 N/A N/A indent N/A indent_level _end_of_function N/A N/A line N/A N/A N/A N/A N/A line N/A N/A N/A line startswith indent N/A N/A N/A line startswith # N/A N/A start_pos N/A self pos N/A N/A N/A self pos N/A self n N/A N/A line N/A N/A self lines N/A N/A self pos N/A N/A _end_of_function line N/A N/A N/A N/A self _push_count start_pos N/A N/A N/A self pos 1 N/A N/A _is_def_line line N/A N/A N/A N/A self _count_function indent_level N/A indent_level 1 N/A N/A N/A self _push_count start_pos N/A _push_count N/A N/A self start_pos N/A N/A N/A func_lines N/A N/A self lines N/A start_pos N/A self pos N/A N/A N/A len func_lines 300 N/A N/A N/A set_trace N/A N/A N/A N/A len func_lines 0 N/A N/A func_lines N/A -1 N/A N/A func_lines N/A func_lines N/A -1 N/A clean_lines N/A N/A in_docstring False N/A line func_lines N/A N/A line N/A N/A line strip N/A N/A in_docstring N/A _is_triplequote line N/A N/A in_docstring False N/A N/A N/A N/A line startswith # N/A N/A N/A N/A _is_triplequote line N/A N/A in_docstring True N/A N/A N/A N/A N/A self counts append N/A len func_lines N/A N/A _get_indent_level N/A N/A line N/A N/A N/A level 0 N/A N/A N/A line startswith N/A level N/A N/A level 1 N/A level N/A _is_triplequote N/A N/A line N/A N/A N/A N/A N/A N/A line startswith """ N/A N/A line startswith ''' N/A _get_file_function_lengths N/A N/A path N/A N/A N/A lines N/A N/A N/A x rstrip N/A x N/A N/A N/A open path readlines N/A counter N/A LengthCounter lines N/A N/A N/A counter get_counts N/A N/A text 
class Foo:

def foo():
    def bar():
        a = 1

        b = 2

        c = 3

    foo = 'bar'

def x():
    a = 1

    b = 3

    c = 7

    pass
 N/A expected N/A 5 8 7 N/A lines N/A N/A N/A x rstrip N/A x N/A N/A text splitlines N/A counter N/A LengthCounter lines N/A result N/A N/A counter get_counts N/A N/A result expected doit N/A N/A N/A N/A N/A N/A directory _ files walked N/A N/A N/A print directory N/A path files N/A N/A N/A N/A _should_count_file path N/A N/A N/A full_path N/A N/A N/A os path join directory path N/A N/A print full_path N/A lines N/A len N/A N/A N/A open full_path readlines N/A N/A N/A dirs append directory N/A N/A N/A names append path N/A N/A N/A lengths append lines N/A result N/A DataFrame N/A dirs names lengths dirs names lengths N/A doit2 N/A N/A N/A N/A N/A counts N/A N/A N/A directory _ files walked N/A N/A N/A print directory N/A path files N/A N/A N/A N/A N/A _should_count_file path N/A N/A path startswith test_ N/A N/A N/A full_path N/A N/A N/A os path join directory path N/A N/A counts N/A full_path N/A _get_file_function_lengths full_path N/A counts N/A N/A counts N/A doit2 N/A all_counts N/A N/A N/A k v N/A N/A compat iteritems counts N/A N/A N/A N/A all_counts extend v N/A all_counts N/A N/A np array all_counts N/A fig N/A N/A plt figure figsize N/A 10 5 N/A ax N/A N/A fig add_subplot 111 N/A N/A N/A ax hist all_counts bins 100 N/A n N/A len all_counts N/A nmore N/A N/A N/A all_counts 50 sum N/A N/A N/A ax set_title N/A %s function lengths, n=%d N/A pandas n N/A N/A N/A ax set_ylabel N functions N/A N/A N/A ax set_xlabel Function length N/A N/A N/A ax text 100 300 N/A %.3f%% with > 50 lines N/A N/A n nmore N/A float n fontsize 18 N/A N/A N/A plt show