def countLines(paths, exclude_files_containing=[],<EOL>exclude_folders_containing=[],<EOL>exclude_blank_lines=True,<EOL>exclude_commented_lines=True,<EOL>count_only_py_files=True):
exclude_files_containing = list(exclude_files_containing)<EOL>exclude_files_containing.append("<STR_LIT>")<EOL>loclist = []  <EOL>if isinstance(paths, string_types):<EOL><INDENT>paths = [paths]<EOL><DEDENT>if not len(paths):<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>ignore = []  <EOL>excl = []  <EOL>if exclude_blank_lines or exclude_commented_lines:<EOL><INDENT>ignore.extend(['<STR_LIT:U+0020>', '<STR_LIT:\t>', '<STR_LIT:\n>'])<EOL><DEDENT>if exclude_commented_lines:<EOL><INDENT>excl.append('<STR_LIT:#>')<EOL><DEDENT>for cur_path in paths:<EOL><INDENT>print('<STR_LIT>' % cur_path)<EOL>for pydir, _, pyfiles in os.walk(cur_path):<EOL><INDENT>for pyfile in pyfiles:<EOL><INDENT>if ((not count_only_py_files or pyfile.endswith("<STR_LIT>"))<EOL>and not sum([ex in pydir for ex in exclude_folders_containing])<EOL>and not sum([ex in pyfile for ex in exclude_files_containing])<EOL>):<EOL><INDENT>totalpath = os.path.join(pydir, pyfile)<EOL>lines = open(totalpath, "<STR_LIT:r>").readlines()<EOL>if ignore:<EOL><INDENT>n = <NUM_LIT:0><EOL>for l in lines:<EOL><INDENT>for i, sign in enumerate(l):<EOL><INDENT>if sign not in ignore:<EOL><INDENT>if sign in excl:<EOL><INDENT>i = len(l)<EOL><DEDENT>break<EOL><DEDENT><DEDENT>if i and i < len(l):<EOL><INDENT>n += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>n = len(lines)<EOL><DEDENT>loclist.append((n,<EOL>totalpath.split(cur_path)[<NUM_LIT:1>]))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for linenumbercount, filename in loclist:<EOL><INDENT>print("<STR_LIT>" % (linenumbercount, filename))<EOL><DEDENT>print("<STR_LIT>" %<EOL>(sum([x[<NUM_LIT:0>] for x in loclist]), len(paths)))<EOL>
count and return lines  of all *.py files in the given directory/-ies

[paths] --> file path or list of paths to recursively count code line
[exclude_(files/folders)_containing]
        --> list of phases in folder/file name to be excluded
            e.g. ['test', 'build']