<commit_before>/*
 * Copyright 2006 - 2016
 * <NAME> or his licensors, as applicable
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * central naming stuff
 */

#ifndef SETUP_CEXT_H
#define SETUP_CEXT_H

#ifndef EXT_MODULE
#error EXT_MODULE must be defined outside of this file (-DEXT_MODULE=...)
#endif

/*
 * include core header files
 */
#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h"

/*
 * define our helper macros depending on the stuff above
 */
#define STRINGIFY(n) STRINGIFY_HELPER(n)
#define STRINGIFY_HELPER(n) #n
#define CONCATENATE(first, second) CONCATENATE_HELPER(first, second)
#define CONCATENATE_HELPER(first, second) first##second

#define EXT_MODULE_NAME  STRINGIFY(EXT_MODULE)
#ifdef EXT_PACKAGE
#define EXT_PACKAGE_NAME STRINGIFY(EXT_PACKAGE)
#define EXT_MODULE_PATH  EXT_PACKAGE_NAME "." EXT_MODULE_NAME
#else
#define EXT_PACKAGE_NAME ""
#define EXT_MODULE_PATH  EXT_MODULE_NAME
#endif

#define EXT_DOCS_VAR      CONCATENATE(var, CONCATENATE(EXT_MODULE, __doc__))
#define EXT_METHODS_VAR   CONCATENATE(var, CONCATENATE(EXT_MODULE, _methods))
#define EXT_METHODS       static PyMethodDef EXT_METHODS_VAR[]

#define EXT_DEFINE_VAR    CONCATENATE(var, CONCATENATE(EXT_MODULE, _module))

/* Py3K Support */
#if PY_MAJOR_VERSION >= 3

#if PY_VERSION_HEX >= 0x03040000
#define TEXT_SIGNATURE
#endif

#define EXT3

#ifndef Py_TPFLAGS_HAVE_CLASS
#define Py_TPFLAGS_HAVE_CLASS (0)
#endif

#ifndef Py_TPFLAGS_HAVE_WEAKREFS
#define Py_TPFLAGS_HAVE_WEAKREFS (0)
#endif

#ifndef Py_TPFLAGS_HAVE_ITER
#define Py_TPFLAGS_HAVE_ITER (0)
#endif

#ifndef Py_TPFLAGS_HAVE_SEQUENCE_IN
#define Py_TPFLAGS_HAVE_SEQUENCE_IN (0)
#endif

#ifndef PyMODINIT_FUNC
#define EXT_INIT_FUNC PyObject *CONCATENATE(PyInit_, EXT_MODULE)(void)
#else
#define EXT_INIT_FUNC PyMODINIT_FUNC CONCATENATE(PyInit_, EXT_MODULE)(void)
#endif

#define EXT_DEFINE(name, methods, doc) \
static struct PyModuleDef EXT_DEFINE_VAR = { \
    PyModuleDef_HEAD_INIT, \
    name,                  \
    doc,                   \
    -1,                    \
    methods,               \
    NULL,                  \
    NULL,                  \<commit_msg>another fancy type flag missing in py3<commit_after>/*
 * Copyright 2006 - 2016
 * <NAME> or his licensors, as applicable
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * central naming stuff
 */

#ifndef SETUP_CEXT_H
#define SETUP_CEXT_H

#ifndef EXT_MODULE
#error EXT_MODULE must be defined outside of this file (-DEXT_MODULE=...)
#endif

/*
 * include core header files
 */
#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h"

/*
 * define our helper macros depending on the stuff above
 */
#define STRINGIFY(n) STRINGIFY_HELPER(n)
#define STRINGIFY_HELPER(n) #n
#define CONCATENATE(first, second) CONCATENATE_HELPER(first, second)
#define CONCATENATE_HELPER(first, second) first##second

#define EXT_MODULE_NAME  STRINGIFY(EXT_MODULE)
#ifdef EXT_PACKAGE
#define EXT_PACKAGE_NAME STRINGIFY(EXT_PACKAGE)
#define EXT_MODULE_PATH  EXT_PACKAGE_NAME "." EXT_MODULE_NAME
#else
#define EXT_PACKAGE_NAME ""
#define EXT_MODULE_PATH  EXT_MODULE_NAME
#endif

#define EXT_DOCS_VAR      CONCATENATE(var, CONCATENATE(EXT_MODULE, __doc__))
#define EXT_METHODS_VAR   CONCATENATE(var, CONCATENATE(EXT_MODULE, _methods))
#define EXT_METHODS       static PyMethodDef EXT_METHODS_VAR[]

#define EXT_DEFINE_VAR    CONCATENATE(var, CONCATENATE(EXT_MODULE, _module))

/* Py3K Support */
#if PY_MAJOR_VERSION >= 3

#if PY_VERSION_HEX >= 0x03040000
#define TEXT_SIGNATURE
#endif

#define EXT3

#ifndef Py_TPFLAGS_HAVE_CLASS
#define Py_TPFLAGS_HAVE_CLASS (0)
#endif

#ifndef Py_TPFLAGS_HAVE_WEAKREFS
#define Py_TPFLAGS_HAVE_WEAKREFS (0)
#endif

#ifndef Py_TPFLAGS_HAVE_ITER
#define Py_TPFLAGS_HAVE_ITER (0)
#endif

#ifndef Py_TPFLAGS_HAVE_RICHCOMPARE
#define Py_TPFLAGS_HAVE_RICHCOMPARE (0)
#endif

#ifndef Py_TPFLAGS_HAVE_SEQUENCE_IN
#define Py_TPFLAGS_HAVE_SEQUENCE_IN (0)
#endif

#ifndef PyMODINIT_FUNC
#define EXT_INIT_FUNC PyObject *CONCATENATE(PyInit_, EXT_MODULE)(void)
#else
#define EXT_INIT_FUNC PyMODINIT_FUNC CONCATENATE(PyInit_, EXT_MODULE)(void)
#endif

#define EXT_DEFINE(name, methods, doc) \
static struct PyModuleDef EXT_DEFINE_VAR = { \
    PyModuleDef_HEAD_INIT, \
    name,                  \
    doc,                   \
    -1,                    \
    methods,               \
    NULL,                  \
    NULL,                  \
{'fraction_non_alphanumeric': 0.0821842250413679, 'fraction_numerical': 0.011031439602868174, 'mean_word_length': 4.161290322580645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1014112', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1845, 'n_words': 506}