<commit_before># coding: utf-8

import os
import commands
from fabkit import conf, api


# create directory, if directory not exists
def create_dir(directory, is_create_init_py=False):
    if not os.path.exists(directory):
        os.makedirs(directory)
        print '"{0}" is created.'.format(directory)
        if is_create_init_py:
            init_py = os.path.join(directory, '__init__.py')
            with open(init_py, 'w') as f:
                f.write('# coding: utf-8')
                print '"{0} is created."'.format(init_py)


def git_clone_required_fablib():
    for fablib_name in conf.CONFIG.options('fablib'):
        fablib = os.path.join(conf.FABLIB_MODULE_DIR, fablib_name)
        git_repo = conf.CONFIG.get('fablib', fablib_name)

        if not os.path.exists(fablib) and not api.env.is_test:
            cmd_gitclone = 'git clone {0} {1}'.format(git_repo, fablib)
            if util.confirm('{0} is not exists in fablib.\nDo you want to run "{1}"?'.format(fablib_name, cmd_gitclone), 'Canceled.'):  # noqa
                (status, output) = commands.getstatusoutput(cmd_gitclone)
                print output
                if status != 0:
                    exit(0)
            else:
                exit(0)


def create_required_dirs():
    create_dir(conf.STORAGE_DIR)<commit_msg>fixed git_clone_required_fablib()<commit_after># coding: utf-8

import os
import commands
from fabkit import conf, api
from terminal import confirm


# create directory, if directory not exists
def create_dir(directory, is_create_init_py=False):
    if not os.path.exists(directory):
        os.makedirs(directory)
        print '"{0}" is created.'.format(directory)
        if is_create_init_py:
            init_py = os.path.join(directory, '__init__.py')
            with open(init_py, 'w') as f:
                f.write('# coding: utf-8')
                print '"{0} is created."'.format(init_py)


def git_clone_required_fablib():
    for fablib_name in conf.CONFIG.options('fablib'):
        fablib = os.path.join(conf.FABLIB_MODULE_DIR, fablib_name)
        git_repo = conf.CONFIG.get('fablib', fablib_name)

        if not os.path.exists(fablib) and not api.env.is_test:
            cmd_gitclone = 'git clone {0} {1}'.format(git_repo, fablib)
            if confirm('{0} is not exists in fablib.\nDo you want to run "{1}"?'.format(fablib_name, cmd_gitclone), 'Canceled.'):  # noqa
                (status, output) = commands.getstatusoutput(cmd_gitclone)
                print output
                if status != 0:
                    exit(0)
            else:
                exit(0)


def create_required_dirs():
    create_dir(conf.STORAGE_DIR)
{'fraction_non_alphanumeric': 0.11581709145427287, 'fraction_numerical': 0.008245877061469266, 'mean_word_length': 2.461738002594034, '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': '7455965', 'n_tokens_mistral': 861, 'n_tokens_neox': 860, 'n_words': 202}