<commit_before>import sys
import os
import shutil
import subprocess

import clowder.log
import clowder.utilities

class Herd(object):

    def __init__(self, version):
        if version == None:
            self.sync()
        else:
            self.syncVersion(version)

    def sync(self):
        command = 'repo forall -c git stash'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo forall -c git checkout master'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo sync'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo forall -c git checkout master'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

    def syncVersion(self, version):
        command = 'repo forall -c git stash'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo init -m ' + version + '.xml'
        print("Running '" + command + "'")<commit_msg>`clowder herd` syncs to default manifest<commit_after>import sys
import os
import shutil
import subprocess

import clowder.log
import clowder.utilities

class Herd(object):

    def __init__(self, version):
        if version == None:
            self.sync()
        else:
            self.syncVersion(version)

    def sync(self):
        command = 'repo forall -c git stash'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo forall -c git checkout master'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo init -m default.xml'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo sync'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo forall -c git checkout master'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

    def syncVersion(self, version):
        command = 'repo forall -c git stash'
        print("Running '" + command + "'")
        clowder.utilities.ex(command)

        command = 'repo init -m ' + version + '.xml'
        print("Running '" + command + "'")
{'fraction_non_alphanumeric': 0.12792714657415438, 'fraction_numerical': 0.0, 'mean_word_length': 2.2584745762711864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '2172322', 'n_tokens_mistral': 686, 'n_tokens_neox': 664, 'n_words': 173}