<commit_before>import os
import subprocess

"""
@author: CarolinaFernandez

Utils for the installation of OCF modules.
"""

ocf_path = os.path.join(os.path.dirname(__file__), "../../")
deploy_path = os.path.join(ocf_path, "deploy")
gui_path = os.path.join(deploy_path, "gui")
common_path = os.path.join(deploy_path, "common")
dependencies_path = os.path.join(deploy_path, "dependencies")

## Print

def print_header(text):
    print "\033[94m%s\033[0m" % str(text)

def print_error(text):
    print "\033[91m%s\033[0m" % str(text)

## Paths and files

def get_modules():
    unallowed_folders = [".git", "core", "deploy", "doc", "modules"]
    ocf_modules = sorted(os.walk(ocf_path).next()[1])
    for unallowed_folder in unallowed_folders:
        try:
            ocf_modules.remove(unallowed_folder)
        except ValueError:
            pass
    return ocf_modules
<commit_msg>Automatic merge of 'ocf' (9582d46) into 'master'<commit_after>import os
import subprocess

"""
@author: CarolinaFernandez

Utils for the installation of OCF modules.
"""

ocf_path = os.path.join(os.path.dirname(__file__), "../../")
deploy_path = os.path.join(ocf_path, "deploy")
gui_path = os.path.join(deploy_path, "gui")
common_path = os.path.join(deploy_path, "common")
dependencies_path = os.path.join(deploy_path, "dependencies")

## Print

def print_header(text):
    print "\033[94m%s\033[0m" % str(text)

def print_error(text):
    print "\033[91m%s\033[0m" % str(text)

## Paths and files

def get_modules():
    unallowed_folders = [".git", "core*", "deploy*", "doc", "modules"]
    ocf_modules = sorted(os.walk(ocf_path).next()[1])
    for unallowed_folder in unallowed_folders:
        try:
            if unallowed_folder.endswith("*"):
                unallowed_folder = unallowed_folder[:-1]
                ocf_modules = filter(lambda x: not x.startswith(unallowed_folder), ocf_modules)
            elif unallowed_folder.startswith("*"):
                unallowed_folder = unallowed_folder[1:]
                ocf_modules = filter(lambda x: not x.endswith(unallowed_folder), ocf_modules)
            ocf_modules.remove(unallowed_folder)
        except ValueError:
            pass
    return ocf_modules

{'fraction_non_alphanumeric': 0.13941871026339692, 'fraction_numerical': 0.02089009990917348, 'mean_word_length': 3.647679324894515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6161420', 'n_tokens_mistral': 795, 'n_tokens_neox': 750, 'n_words': 150}