<commit_before>from git_connect import connect
import os


def getRepos():
    """Returns all the repos under the user."""
    github = connect()
    user = github.get_user()
    # Get all Repos!
    all_repos = user.get_repos()
    return all_repos


if __name__ == '__main__':
    all_repos = getRepos()
    for repo in all_repos:
        # Clone the repo.
        os.system('git clone ' + repo.clone_url)
    print("Cloned all your Repos.")
<commit_msg>Updated, using subprocess instead of os modules. See https://www.reddit.com/r/Python/comments/3gysxt/python_script_that_clones_all_your_repos/cu2ov0j<commit_after>from git_connect import connect
import subprocess


def getRepos():
    """Returns all the repos under the user."""
    github = connect()
    user = github.get_user()
    # Get all Repos!
    all_repos = user.get_repos()
    return all_repos


if __name__ == '__main__':
    all_repos = getRepos()
    for repo in all_repos:
        # Clone the repo.
        if not subprocess.check_call(['git', 'clone', repo.clone_url]):
            # Returns 0 when ran successfully and 1 otherwise.
            pass
        else:
            print("Clone failed! Try again.")

{'fraction_non_alphanumeric': 0.10228233305156383, 'fraction_numerical': 0.00422654268808115, 'mean_word_length': 2.869281045751634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2379421', 'n_tokens_mistral': 388, 'n_tokens_neox': 364, 'n_words': 110}