<commit_before>import os

from distutils.core import setup, Extension
from Cython.Build import cythonize


def ensure_protobuf():
    exists = os.path.exists("clstm.pb.cc")
    stale = (exists and
             os.path.getctime("clstm.pb.cc") < os.path.getctime("clstm.proto"))
    if not exists or stale:
        print "Generating proto file"
        os.system("protoc clstm.proto --cpp_out=.")


ext = Extension(
    "pyclstm",
    sources=['pyclstm.pyx', 'clstm.cc', 'clstm_prefab.cc', 'extras.cc',
             'batches.cc', 'ctc.cc', 'clstm_proto.cc', 'clstm.pb.cc',
             'clstm_compute.cc', 'tensor.cc'],
    include_dirs=['/usr/include/eigen3', '/usr/local/include/eigen3',
                  '/usr/local/include', '/usr/include',
                  '/usr/include/hdf5/serial', '/usr/include/hdf5'],
    libraries=['protobuf', 'png'],
    language='c++',
    extra_compile_args=['-w', '-std=c++11', '-Wno-unused-result', '-g',
                        '-DNODISPLAY=1', '-DTHROW=throw', '-DNDEBUG', '-Ofast',
                        '-DEIGEN_NO_DEBUG', '-finline', '-ffast-math',
                        '-fno-signaling-nans', '-funsafe-math-optimizations',
                        '-ffinite-math-only', '-march=native'])

ensure_protobuf()
setup(
    name='clstm',
    version='0.1',
    author="<NAME>, <NAME>",
    description="CLSTM Python bindings",
    ext_modules=cythonize([ext]))<commit_msg>Embed function signatures into Python extension<commit_after>import os

from distutils.core import setup, Extension
from Cython.Build import cythonize


def ensure_protobuf():
    exists = os.path.exists("clstm.pb.cc")
    stale = (exists and
             os.path.getctime("clstm.pb.cc") < os.path.getctime("clstm.proto"))
    if not exists or stale:
        print "Generating proto file"
        os.system("protoc clstm.proto --cpp_out=.")


ext = Extension(
    "pyclstm",
    sources=['pyclstm.pyx', 'clstm.cc', 'clstm_prefab.cc', 'extras.cc',
             'batches.cc', 'ctc.cc', 'clstm_proto.cc', 'clstm.pb.cc',
             'clstm_compute.cc', 'tensor.cc'],
    include_dirs=['/usr/include/eigen3', '/usr/local/include/eigen3',
                  '/usr/local/include', '/usr/include',
                  '/usr/include/hdf5/serial', '/usr/include/hdf5'],
    libraries=['protobuf', 'png'],
    language='c++',
    extra_compile_args=['-w', '-std=c++11', '-Wno-unused-result', '-g',
                        '-DNODISPLAY=1', '-DTHROW=throw', '-DNDEBUG', '-Ofast',
                        '-DEIGEN_NO_DEBUG', '-finline', '-ffast-math',
                        '-fno-signaling-nans', '-funsafe-math-optimizations',
                        '-ffinite-math-only', '-march=native'])

ensure_protobuf()
setup(
    name='clstm',
    version='0.1',
    author="<NAME>, <NAME>",
    description="CLSTM Python bindings",
    ext_modules=cythonize([ext], compiler_directives={'embedsignature': True}))
{'fraction_non_alphanumeric': 0.18379310344827587, 'fraction_numerical': 0.006206896551724138, 'mean_word_length': 2.5551470588235294, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '1473979', 'n_tokens_mistral': 1002, 'n_tokens_neox': 980, 'n_words': 164}