def get_all_words_in_path(path): trees = get_filled_trees(path) functions = [ f for f in flat([get_all_names(t) for t in trees]) if not (f.startswith('__') and f.endswith('__')) ] return flat([ split_snake_case_name_to_words(function_) for function_ in functions ])
def get_top_variables_names_in_path(path, top_size=10): trees = get_filled_trees(path) functions = get_public_variables_names_in_trees(trees) nms = flat([ split_snake_case_name_to_words(function_) for function_ in functions ]) return collections.Counter(nms).most_common(top_size)
def get_top_nouns_in_path(path, top_size=10): trees = get_filled_trees(path) functions = get_public_functions_names_in_trees(trees) nouns = flat([ get_nouns_from_function_name(function_name) for function_name in functions ]) return collections.Counter(nouns).most_common(top_size)