<commit_before>/// @file
/// @author uentity
/// @date 03.04.2017
/// @brief Common declarations for making Python bindings
/// @copyright
/// This Source Code Form is subject to the terms of the Mozilla Public License,
/// v. 2.0. If a copy of the MPL was not distributed with this file,
/// You can obtain one at https://mozilla.org/MPL/2.0/

#pragma once

#include <pybind11/pybind11.h>
// for auto-support of std containers
#include <pybind11/stl.h>
#include <pybind11/stl_bind.h>
// operator overloading support
#include <pybind11/operators.h>

#include <bs/error.h>
#include <bs/objbase.h>
#include <bs/type_macro.h>
#include <bs/kernel/misc.h>
#include <bs/python/kernel.h>

typedef void (*bs_init_py_fn)(void*);

/*-----------------------------------------------------------------------------
 *  macro definitions
 *-----------------------------------------------------------------------------*/
// init Python subsystem in BS plugin
#define BS_INIT_PY(mod_name)                                                              \
BS_C_API_PLUGIN const blue_sky::plugin_descriptor* bs_get_plugin_descriptor();            \
static void bs_init_py_subsystem_##mod_name(pybind11::module&);                           \
BS_C_API_PLUGIN void bs_init_py_subsystem(void* py_plugin_module) {                       \
    if(!py_plugin_module) return;                                                         \
    bs_init_py_subsystem_##mod_name(*static_cast< pybind11::module* >(py_plugin_module)); \
}                                                                                         \
PYBIND11_MODULE(mod_name, m) {                                                            \
    bs_init_py_subsystem_##mod_name(m);                                                   \
}                                                                                         \
void bs_init_py_subsystem_##mod_name(pybind11::module& m)

// this macro turns on `pyobj` property in any BS type T (`pyobj` is enabled for objbase)
// to use it you *have* to declare constructors with `py::init_alias`
// and *have trampoline class* derived from py_object<T>
#define BSPY_ENABLE_PYOBJ_(T_tup)                                                      \<commit_msg>python: remove unused declaraion from BS_INIT_PY macro<commit_after>/// @file
/// @author uentity
/// @date 03.04.2017
/// @brief Common declarations for making Python bindings
/// @copyright
/// This Source Code Form is subject to the terms of the Mozilla Public License,
/// v. 2.0. If a copy of the MPL was not distributed with this file,
/// You can obtain one at https://mozilla.org/MPL/2.0/

#pragma once

#include <pybind11/pybind11.h>
// for auto-support of std containers
#include <pybind11/stl.h>
#include <pybind11/stl_bind.h>
// operator overloading support
#include <pybind11/operators.h>

#include <bs/error.h>
#include <bs/objbase.h>
#include <bs/type_macro.h>
#include <bs/kernel/misc.h>
#include <bs/python/kernel.h>

typedef void (*bs_init_py_fn)(void*);

/*-----------------------------------------------------------------------------
 *  macro definitions
 *-----------------------------------------------------------------------------*/
// init Python subsystem in BS plugin
#define BS_INIT_PY(mod_name)                                                              \
static void bs_init_py_subsystem_##mod_name(pybind11::module&);                           \
BS_C_API_PLUGIN void bs_init_py_subsystem(void* py_plugin_module) {                       \
    if(!py_plugin_module) return;                                                         \
    bs_init_py_subsystem_##mod_name(*static_cast< pybind11::module* >(py_plugin_module)); \
}                                                                                         \
PYBIND11_MODULE(mod_name, m) {                                                            \
    bs_init_py_subsystem_##mod_name(m);                                                   \
}                                                                                         \
void bs_init_py_subsystem_##mod_name(pybind11::module& m)

// this macro turns on `pyobj` property in any BS type T (`pyobj` is enabled for objbase)
// to use it you *have* to declare constructors with `py::init_alias`
// and *have trampoline class* derived from py_object<T>
#define BSPY_ENABLE_PYOBJ_(T_tup)                                                      \
{'fraction_non_alphanumeric': 0.16173480912581883, 'fraction_numerical': 0.01355319629545968, 'mean_word_length': 1.3503184713375795, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4102363', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1115, 'n_words': 294}