<commit_before>// Find the GitHub branch we are running from
getBranch = function (path, repository) {
    // The branch is the word after the repository name, and before the word "tests"
    // Assumes that the branch exists in the path
    
    // Note that the repository includes a final '/'
    var repositoryName = repository.slice(0,-1);
    
    var words = path.split("/");
    for (var i = 0; i < words.length - 2; ++i) {
        if (words[i] === repositoryName && words[i + 2] === "tests") {
            return words[i + 1];
        }
    }
    
    return "branch not found";
}<commit_msg>Deal with call from local script.<commit_after>// Find the GitHub branch we are running from
getBranch = function (path, repository) {
    // The branch is the word after the repository name, and before the word "tests"
    // Assumes that the branch exists in the path

    // Note that the repository includes a final '/'
    var repositoryName = repository.slice(0,-1);

    var words = path.split("/");

    // If the first word is not "https" then the script is probably running from a local file
    // In this case, assume the required branch is "master"
    if (words[0] !== "htpps") {
        return "master";
    }

    for (var i = 0; i < words.length - 2; ++i) {
        if (words[i] === repositoryName && words[i + 2] === "tests") {
            return words[i + 1];
        }
    }

    // This should never happen
    return "branch not found";
}
{'fraction_non_alphanumeric': 0.1218343600273785, 'fraction_numerical': 0.00889801505817933, 'mean_word_length': 2.4, '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': '1046029', 'n_tokens_mistral': 426, 'n_tokens_neox': 410, 'n_words': 178}