<commit_before># Copyright (c) 2014, <NAME>
# All rights reserved.
#
# This file is covered by the 3-clause BSD license.
# See the LICENSE file in this program's distribution for details.

import zipfile, glob, os.path
from sys import argv
from os import listdir

def main (inpath, outpath):
    inpath  = os.path.normpath (inpath)
    outpath = os.path.normpath (outpath)
    if not os.path.exists (inpath):
        raise ValueError ("{} does not exist!".format (inpath))
    outfile = os.path.join (outpath, "PyDoom.zip")
    print ("Writing {}...".format (outfile))

    with zipfile.ZipFile (outfile, "w") as openedzip:
        fnames = listdir (inpath)
        total = 0

        for fn in fnames:
            print ("- Adding {}".format (fn))
            openedzip.write (os.path.join (inpath, fn), arcname=fn)
            total += 1

    print ("{} total file{} written.".format (total, ("s" if total != 1 else "")))

if __name__ == "__main__":
    main (argv[1], argv[2])<commit_msg>MakeProgramZip tweaking<commit_after># Copyright (c) 2014, <NAME>
# All rights reserved.
#
# This file is covered by the 3-clause BSD license.
# See the LICENSE file in this program's distribution for details.

import zipfile, glob, os.path
from sys import argv
from glob import glob

def main (inpath, outpath):
    inpath  = os.path.normpath (inpath)
    outpath = os.path.normpath (outpath)
    if not os.path.exists (inpath):
        raise ValueError ("{} does not exist!".format (inpath))
    outfile = os.path.join (outpath, "PyDoom.zip")
    print ("Writing {}...".format (outfile))

    with zipfile.ZipFile (outfile, "w") as openedzip:
        fnames = (i[len(inpath)+1:] for i in glob (os.path.join (inpath, '*.py')))
        total = 0

        for fn in fnames:
            print ("- Adding {}".format (fn))
            openedzip.write (os.path.join (inpath, fn), arcname=fn)
            total += 1

    print ("{} total file{} written.".format (total, ("s" if total != 1 else "")))

if __name__ == "__main__":
    main (argv[1], argv[2])
{'fraction_non_alphanumeric': 0.14362745098039215, 'fraction_numerical': 0.010294117647058823, 'mean_word_length': 2.872865275142315, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '62766', 'n_tokens_mistral': 687, 'n_tokens_neox': 656, 'n_words': 224}