<commit_before>import os
import re

from .utils import run_command


class Repo:

    @staticmethod
    def clone(url, clone_to):
        """Clone repo"""
        repo_type = re.search(r'^(?:ssh)://(git|hg)', url).group(1)

        if repo_type == "hg":
            cmd = 'hg clone {} {}'.format(url, clone_to)
        else:
            cmd = 'git clone {} {}'.format(url, clone_to)

        return run_command(cmd)

    @staticmethod
    def pull(repo_dir):
        """Pull changes from remote repo"""
        os.chdir(repo_dir)<commit_msg>repo type finding regex updated<commit_after>import os
import re

from .utils import run_command


class Repo:

    @staticmethod
    def clone(url, clone_to):
        """Clone repo"""
        repo_type = re.search(r'^((?:ssh)://)?(git|hg)', url).group(1)

        if repo_type == "hg":
            cmd = 'hg clone {} {}'.format(url, clone_to)
        else:
            cmd = 'git clone {} {}'.format(url, clone_to)

        return run_command(cmd)

    @staticmethod
    def pull(repo_dir):
        """Pull changes from remote repo"""
        os.chdir(repo_dir)
{'fraction_non_alphanumeric': 0.14777878513145964, 'fraction_numerical': 0.001813236627379873, 'mean_word_length': 2.396923076923077, 'pattern_counts': {'":': 2, '<': 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': '4844207', 'n_tokens_mistral': 369, 'n_tokens_neox': 348, 'n_words': 91}