<commit_before>import subprocess
import os
from config import GIT_REPO_DIR_PATH, GIT_REPO_URL, POSTS_REPO_NAME, SOURCE_DIRECTORY


def git_update():
    """
        Update the GIT database repo
    """
    try:
        if check_local_repo():
            os.chdir(GIT_REPO_DIR_PATH)
            git_pull(GIT_REPO_DIR_PATH)
            os.chdir(SOURCE_DIRECTORY)
        else:
            print('Some problem with the repo, repo doesnt exist')
    except Exception as e:
        raise e


def git_pull(path):
    """
        Run git clone at path
    """
    try:
        subprocess.call(['git', 'clone', path])
    except Exception as e:
        raise e


def git_clone(path):
    """
        Run git clone at path
    """
    try:
        subprocess.call(['git', 'clone', path])
    except Exception as e:
        raise e


def check_local_repo():
    """<commit_msg>Update gitmanager.py<commit_after>import subprocess
import os
from config import GIT_REPO_DIR_PATH, GIT_REPO_URL, POSTS_REPO_NAME, SOURCE_DIRECTORY


def git_update():
    """
        Update the GIT database repo
    """
    try:
        import pdb;pdb.set_trace()
        if check_local_repo():
            os.chdir(GIT_REPO_DIR_PATH)
            git_pull()
            os.chdir(SOURCE_DIRECTORY)
        else:
            print('Some problem with the repo, repo doesnt exist')
    except Exception as e:
        raise e


def git_pull():
    """
        Run git pull current working path
    """
    try:
        subprocess.call(['git', 'pull'])
    except Exception as e:
        raise e


def git_clone(path):
    """
        Run git clone at path
    """
    try:
        subprocess.call(['git', 'clone', path])
    except Exception as e:
        raise e


def check_local_repo():
    """
{'fraction_non_alphanumeric': 0.09772727272727273, 'fraction_numerical': 0.0, 'mean_word_length': 2.1446428571428573, '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': '2594592', 'n_tokens_mistral': 559, 'n_tokens_neox': 546, 'n_words': 153}