<commit_before>/// @file
/// @author uentity
/// @date 25.03.2017
/// @brief Python subsystem of BS kernel
/// @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/

#include <bs/bs.h>
#include <bs/python/nparray.h>

namespace blue_sky { namespace python {
namespace py = pybind11;

void py_bind_common(py::module& m);
void py_bind_messaging(py::module& m);
void py_bind_objbase(py::module& m);
void py_bind_misc(py::module& m);
void py_bind_kernel(py::module& m);
void py_bind_tree(py::module& m);
void py_bind_error(py::module& m);
void py_bind_log(py::module& m);

BS_INIT_PY(bs) {
	// initialize kernel first
	BS_KERNEL.init();
	// bind
	py_bind_common(m);
	py_bind_log(m);
	py_bind_error(m);
	py_bind_objbase(m);
	py_bind_messaging(m);
	py_bind_misc(m);
	py_bind_kernel(m);
	py_bind_tree(m);
}

}}<commit_msg>python/main: auto-shutdown kernel on Python interpreter exit<commit_after>/// @file
/// @author uentity
/// @date 25.03.2017
/// @brief Python subsystem of BS kernel
/// @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/

#include <bs/bs.h>
#include <bs/python/nparray.h>

namespace blue_sky { namespace python {
namespace py = pybind11;

void py_bind_common(py::module& m);
void py_bind_messaging(py::module& m);
void py_bind_objbase(py::module& m);
void py_bind_misc(py::module& m);
void py_bind_kernel(py::module& m);
void py_bind_tree(py::module& m);
void py_bind_error(py::module& m);
void py_bind_log(py::module& m);

BS_INIT_PY(bs) {
	// initialize kernel first
	BS_KERNEL.init();
	// register cleanup function
	Py_AtExit([] { BS_KERNEL.shutdown(); });
	// bind
	py_bind_common(m);
	py_bind_log(m);
	py_bind_error(m);
	py_bind_objbase(m);
	py_bind_messaging(m);
	py_bind_misc(m);
	py_bind_kernel(m);
	py_bind_tree(m);
}

}}
{'fraction_non_alphanumeric': 0.15065185900531144, 'fraction_numerical': 0.013520038628681796, 'mean_word_length': 4.66120218579235, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '493531', 'n_tokens_mistral': 810, 'n_tokens_neox': 776, 'n_words': 203}