<commit_before>import sys
import re

from ctypeslib.codegen import typedesc
from tp_puller import TypePuller
from misc import classify, query_items
from cytypes import generic_decl, generic_named_decl
from funcs import generic_as_arg, named_pointer_decl

def generate_cython(output, genitems, enumvals):
    # Generate the cython code
    cython_code = [cy_generate(i) for i in genitems]

    output.write("\tcdef enum:\n")
    for i in enumvals:
        output.write("\t\t%s = %d\n" % (i.name, int(i.value)))
    for i in cython_code:
        if not i:<commit_msg>Do not generate head enum declaration if no anonymous enums are generated.<commit_after>import sys
import re

from ctypeslib.codegen import typedesc
from tp_puller import TypePuller
from misc import classify, query_items
from cytypes import generic_decl, generic_named_decl
from funcs import generic_as_arg, named_pointer_decl

def generate_cython(output, genitems, enumvals):
    # Generate the cython code
    cython_code = [cy_generate(i) for i in genitems]

    if enumvals:
        output.write("\tcdef enum:\n")
        for i in enumvals:
            output.write("\t\t%s = %d\n" % (i.name, int(i.value)))
    for i in cython_code:
        if not i:
{'fraction_non_alphanumeric': 0.08032786885245902, 'fraction_numerical': 0.0, 'mean_word_length': 3.864541832669323, 'pattern_counts': {'":': 0, '<': 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': '3456182', 'n_tokens_mistral': 391, 'n_tokens_neox': 386, 'n_words': 128}