<commit_before>#!/usr/bin/python

import glob
import os
import subprocess
import sys

def usage():
    print("Usage:")
    print("\t", __file__, " <directory list or glob expression>")
    print("Example:")
    print("\t", __file__, " foo/trunk bar/*")

def main(argv):
    try:
        if len(argv) == 2 and argv[1] == "--help":
            usage()
            sys.exit(0)

        procs = []

        for arg in argv[1:]:
            dirs = glob.glob(arg)
            for d in dirs:

                # bzr repo handling
                if os.path.isdir(d) and os.path.isdir(os.path.join(d, ".bzr")):
                    procs.append(
                        (d, subprocess.Popen(
                                ["bzr", "status", d],
                                0, # bufsize
                                None, # executable
                                None, # stdin
                                subprocess.PIPE, # stdout
                                subprocess.PIPE))) # stderr

                # git repo handling
                elif os.path.isdir(d) and os.path.isdir(os.path.join(d, ".git")):
                    procs.append(
                        (d, subprocess.Popen(
                                ["git", "status"],
                                0, # bufsize
                                None, # executable
                                None, # stdin
                                subprocess.PIPE, # stdout
                                subprocess.PIPE, # stderr
                                cwd=d)))


        for (d, p) in procs:
            (output, errors) = p.communicate()
            print("Status for %s" % d)
            if len(output) > 0:
                for l in output.splitlines():
                    print(".. " + l)
            if len(errors) > 0:
                for l in errors.splitlines():
                    print(".. " + l)

    except (Exception) as error:
        print(str(error))
        sys.exit(1)
                
if __name__ == "__main__":
    main(sys.argv)
<commit_msg>Fix print statement in status.py<commit_after>#!/usr/bin/python

import glob
import os
import subprocess
import sys

def usage():
    print("Usage:")
    print("\t", __file__, " <directory list or glob expression>")
    print("Example:")
    print("\t", __file__, " foo/trunk bar/*")

def main(argv):
    try:
        if len(argv) == 2 and argv[1] == "--help":
            usage()
            sys.exit(0)

        procs = []

        for arg in argv[1:]:
            dirs = glob.glob(arg)
            for d in dirs:

                # bzr repo handling
                if os.path.isdir(d) and os.path.isdir(os.path.join(d, ".bzr")):
                    procs.append(
                        (d, subprocess.Popen(
                                ["bzr", "status", d],
                                0, # bufsize
                                None, # executable
                                None, # stdin
                                subprocess.PIPE, # stdout
                                subprocess.PIPE))) # stderr

                # git repo handling
                elif os.path.isdir(d) and os.path.isdir(os.path.join(d, ".git")):
                    procs.append(
                        (d, subprocess.Popen(
                                ["git", "status"],
                                0, # bufsize
                                None, # executable
                                None, # stdin
                                subprocess.PIPE, # stdout
                                subprocess.PIPE, # stderr
                                cwd=d)))


        for (d, p) in procs:
            (output, errors) = p.communicate()
            print("Status for %s" % d)
            if len(output) > 0:
                for l in output.splitlines():
                    print(".. " + l.decode("utf-8"))
            if len(errors) > 0:
                for l in errors.splitlines():
                    print(".. " + l.decode("utf-8"))

    except (Exception) as error:
        print(str(error))
        sys.exit(1)
                
if __name__ == "__main__":
    main(sys.argv)

{'fraction_non_alphanumeric': 0.11797346200241254, 'fraction_numerical': 0.0048250904704463205, 'mean_word_length': 0.9780534351145038, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5652566', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1090, 'n_words': 272}