<commit_before>import os.path
from getpass import getpass
from io import BytesIO

from fabric.api import sudo, run, cd, prefix, settings, task, env, put, prompt, shell_env
from fabric.contrib.console import confirm


def install_python():
    sudo('apt-get update')
    sudo('apt-get install python3-pip python3-dev python3-venv')


def fetch_sources_from_repo(repository_url, branch, code_directory):
    with settings(warn_only=True):
        source_existence_check = run('test -d %s' % code_directory)
    if source_existence_check.succeeded:
        remove_repository_command = 'rm -rf %s' % code_directory
        if not confirm('Gonna run "%s". Continue?' % remove_repository_command):
            print('Skipping git clone.')
            return
        sudo(remove_repository_command)
    git_clone_command = 'git clone --branch --single-branch {0} {1} {2}'
    sudo(git_clone_command.format(branch, repository_url, code_directory))


def setup_venv(code_directory):
    venv_folder = 'venv'
    with cd(code_directory):
        sudo('python3 -m venv %s' % venv_folder)
    return os.path.join(code_directory, venv_folder, 'bin')

<commit_msg>Fix git clone command<commit_after>import os.path
from getpass import getpass
from io import BytesIO

from fabric.api import sudo, run, cd, prefix, settings, task, env, put, prompt, shell_env
from fabric.contrib.console import confirm


def install_python():
    sudo('apt-get update')
    sudo('apt-get install python3-pip python3-dev python3-venv')


def fetch_sources_from_repo(repository_url, branch, code_directory):
    with settings(warn_only=True):
        source_existence_check = run('test -d %s' % code_directory)
    if source_existence_check.succeeded:
        remove_repository_command = 'rm -rf %s' % code_directory
        if not confirm('Gonna run "%s". Continue?' % remove_repository_command):
            print('Skipping git clone.')
            return
        sudo(remove_repository_command)
    git_clone_command = 'git clone {1} {2} --branch {0} --single-branch'
    sudo(git_clone_command.format(branch, repository_url, code_directory))


def setup_venv(code_directory):
    venv_folder = 'venv'
    with cd(code_directory):
        sudo('python3 -m venv %s' % venv_folder)
    return os.path.join(code_directory, venv_folder, 'bin')


{'fraction_non_alphanumeric': 0.10398613518197573, 'fraction_numerical': 0.006065857885615251, 'mean_word_length': 3.9549356223175964, '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': '6854930', 'n_tokens_mistral': 737, 'n_tokens_neox': 707, 'n_words': 187}