<commit_before>#!/usr/bin/env python
"""Create include files for the Sampler."""
from __future__ import division, print_function

import sys
import os
import re
from time import time
from __builtin__ import intern  # fix for pyflake error


def main():
    """Create include files for the Sampler."""
    if len(sys.argv) != 6:
        print("usage: gcc -E kernel.h | ", sys.argv[0],
              "cfg.h kernel.h sigs.c.ing calls.c.inc info.py",
              file=sys.stderr)
        return
    cfg_h = sys.argv[1]
    kernel_h = sys.argv[2]
    sigs_cpp_inc = sys.argv[3]
    calls_c_inc = sys.argv[4]
    info_py = sys.argv[5]
    papi_counters_max = int(os.environ["PAPI_COUNTERS_MAX"])

    # read and prepare kernels
    kernels = sys.stdin.read().strip()

    # clean kernel.h
    for p, s in (
            ("#.*\n\s*", ""),  # remove comments
            ("\s*\n\s*", ""),  # remove newlines (and surrounding spaces)
            ("\s+", " "),  # all spaces are " "
            ("{[^{]*?}", ""),  # remove anything between {} (no nesting)
            ("typedef .*?;", ""),  # remove typedefs
            (", ", ","),  # remove spaces after kommas
            (" ?\( ?", "("),  # remove spaces before openingparentheses
            (" \)", ")"),  # remove spaces before closing parentheses
            (" \*", "*"),  # remove spaces before asterisks
            ("\*", " *"),  # add spaces before asterisks
            ("\*\w+", "*"),  # remove variable names
            ("; ?", ";\n")):  # reintroduce newlines
        kernels = re.sub(p, s, kernels)
    kernels = kernels.split("\n")[:-1]

    # create sigs.cpp.inc
    argtypes = {
        "char *": "CHARP",<commit_msg>cleaning spaces after asterisks<commit_after>#!/usr/bin/env python
"""Create include files for the Sampler."""
from __future__ import division, print_function

import sys
import os
import re
from time import time
from __builtin__ import intern  # fix for pyflake error


def main():
    """Create include files for the Sampler."""
    if len(sys.argv) != 6:
        print("usage: gcc -E kernel.h | ", sys.argv[0],
              "cfg.h kernel.h sigs.c.ing calls.c.inc info.py",
              file=sys.stderr)
        return
    cfg_h = sys.argv[1]
    kernel_h = sys.argv[2]
    sigs_cpp_inc = sys.argv[3]
    calls_c_inc = sys.argv[4]
    info_py = sys.argv[5]
    papi_counters_max = int(os.environ["PAPI_COUNTERS_MAX"])

    # read and prepare kernels
    kernels = sys.stdin.read().strip()

    # clean kernel.h
    for p, s in (
            ("#.*\n\s*", ""),  # remove comments
            ("\s*\n\s*", ""),  # remove newlines (and surrounding spaces)
            ("\s+", " "),  # all spaces are " "
            ("{[^{]*?}", ""),  # remove anything between {} (no nesting)
            ("typedef .*?;", ""),  # remove typedefs
            (", ", ","),  # remove spaces after kommas
            (" ?\( ?", "("),  # remove spaces before openingparentheses
            (" \)", ")"),  # remove spaces before closing parentheses
            (" \*", "*"),  # remove spaces before asterisks
            ("\* ", "*"),  # remove spaces after asterisks
            ("\*", " *"),  # add spaces before asterisks
            ("\*\w+", "*"),  # remove variable names
            ("; ?", ";\n")):  # reintroduce newlines
        kernels = re.sub(p, s, kernels)
    kernels = kernels.split("\n")[:-1]

    # create sigs.cpp.inc
    argtypes = {
        "char *": "CHARP",
{'fraction_non_alphanumeric': 0.1750508868857226, 'fraction_numerical': 0.004652515266065717, 'mean_word_length': 2.167587476979742, 'pattern_counts': {'":': 2, '<': 3, '<?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': '4089933', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1089, 'n_words': 282}