<commit_before>"""
    Copyright 2016 <NAME>

"""
import sys
import re

args = sys.argv[1:]


def minify(input_path, output_path, comments=False):
    """ Minifies/uglifies file
    args:
        input_path: input file path
        output_path: write-out file path
        comments: Boolean. If False, deletes comments during output.
    returns:
        Minified string.
    example:
        `$ python minify.py ./src/styles.css ./src/output.css`
    """

    pattern = re.compile(r"""
    \s |                                # matches all whitespace characters OR
     (                                  #
        /\*                             # /* AND
        [                               # 0 or more of any character
            \w\s                        #
            (?=\*)                      # (positive lookahead: doesn't make * part of the match)
            :@!"'~,#%&-=;<>`            #
            \.\^\$\+\{\[\]\\\|          #
        ]*                              #
        \*/                             # AND */
     )                                  #
     | //.*\n                           # OR any character from // until end-line (inclusive)
    """, re.VERBOSE)

    # read file and apply regex:
    with open(input_path, "r") as file_in:
        temp = []
        for line in file_in:
            temp.append(line)
        output = ''.join(temp)
        output = pattern.sub('', output)

    # write to file:
    # (`w+` mode: writing/reading; overwrites existing files; creates file if doesn't exit)
    with open(output_path, "w+") as file_out:
        file_out.write(output)

#############################
#           Main            #
#############################
if __name__ == "__main__":
    # specify input and output paths in args:
    minify(args[0], args[1])<commit_msg>bug: Fix regex.<commit_after>"""
    Copyright 2016 <NAME>

"""
import sys
import re

args = sys.argv[1:]


def minify(input_path, output_path, comments=False):
    """ Minifies/uglifies file
    args:
        input_path: input file path
        output_path: write-out file path
        comments: Boolean. If False, deletes comments during output.
    returns:
        Minified string.
    example:
        `$ python minify.py ./src/styles.css ./src/output.css`
    """

    # matches all in-line and multi-line comments; matches all spaces:
    pattern = re.compile(r"""
    \s |                    # matches all whitespace characters OR
     (                      # OR any char between /* */ (inclusive)
        /\*
        (.|\n)*?            # N.b. `*?` performs non-greedy match
        \*/
     )
     | //.*\n               # OR any char from // until new-line (inclusive)
    """, re.VERBOSE)

    # read file and apply regex:
    with open(input_path, "r") as file_in:
        temp = []
        for line in file_in:
            temp.append(line)
        output = ''.join(temp)
        output = pattern.sub('', output)

    # write to file:
    # (`w+` mode: writing/reading; overwrites existing files; creates file if doesn't exit)
    with open(output_path, "w+") as file_out:
        file_out.write(output)

#############################
#           Main            #
#############################
if __name__ == "__main__":
    # specify input and output paths in command line args:
    minify(args[0], args[1])
{'fraction_non_alphanumeric': 0.15469778575703172, 'fraction_numerical': 0.004488330341113106, 'mean_word_length': 1.5422053231939163, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1907074', 'n_tokens_mistral': 979, 'n_tokens_neox': 930, 'n_words': 263}