<commit_before>import os
import sys

import git_util


def main(argv):
    # repo path
    if 1 < len(argv):
        repo_path = argv[1]
    else:
        repo_path = os.getcwd()

    remotes_list = get_remote_list_from_git_remote(repo_path)

    print(remotes_list)


def get_remote_list_from_git_remote(repo_path=os.getcwd()):
    # make git run on a given path
    cmd = 'remote'
    remotes_str = git_path(cmd, repo_path)
    remotes_list = remotes_str.splitlines()

    return tuple(remotes_list)


def git_path(cmd, repo_path=os.getcwd()):
    git_path_spec = "-C '%s'" % repo_path
    git_result_str = git_util.git(' '.join((git_path_spec, cmd)))
    return git_result_str


if __name__ == '__main__':
    main(sys.argv)<commit_msg>get list of branches including remote ones<commit_after>import os
import sys

import git_util


def main(argv):
    # repo path
    if 1 < len(argv):
        repo_path = argv[1]
    else:
        repo_path = os.getcwd()

    remotes_list = get_remote_list_from_git_remote(repo_path)
    print(remotes_list)

    branch_remotes_str = git_path('branch -r', repo_path)
    branch_remote_list = tuple([branch_name.strip() for branch_name in branch_remotes_str.splitlines()])
    print(branch_remote_list)


def get_remote_list_from_git_remote(repo_path=os.getcwd()):
    # make git run on a given path
    cmd = 'remote'
    remotes_str = git_path(cmd, repo_path)
    remotes_list = remotes_str.splitlines()

    return tuple(remotes_list)


def git_path(cmd, repo_path=os.getcwd()):
    git_path_spec = "-C '%s'" % repo_path
    git_result_str = git_util.git(' '.join((git_path_spec, cmd)))
    return git_result_str


if __name__ == '__main__':
    main(sys.argv)
{'fraction_non_alphanumeric': 0.10705882352941176, 'fraction_numerical': 0.002352941176470588, 'mean_word_length': 3.7915492957746477, 'pattern_counts': {'":': 0, '<': 5, '<?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': '84584', 'n_tokens_mistral': 632, 'n_tokens_neox': 614, 'n_words': 128}