<commit_before>#include <vector>
#include <string>
#include <sstream>
#include <cstring>

#include <boost/range/iterator_range.hpp>
#include <boost/property_tree/ptree.hpp>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/numpy.h>

#include <amgcl/runtime.hpp>
#include <amgcl/make_solver.hpp>
#include <amgcl/adapter/crs_tuple.hpp>

namespace amgcl {
#ifdef AMGCL_PROFILING
profiler<> prof;
#endif
}

namespace py = pybind11;

//---------------------------------------------------------------------------
boost::property_tree::ptree make_ptree(const py::dict &args) {
    boost::property_tree::ptree prm;
    for(auto p : args) {
        std::ostringstream key, val;
        key << p.first;
        val << p.second;
        prm.put(key.str(), val.str());
    }
    return prm;
}

//---------------------------------------------------------------------------
template <typename T><commit_msg>Use direct conversion to string for python objects<commit_after>#include <vector>
#include <string>
#include <sstream>
#include <cstring>

#include <boost/range/iterator_range.hpp>
#include <boost/property_tree/ptree.hpp>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/numpy.h>

#include <amgcl/runtime.hpp>
#include <amgcl/make_solver.hpp>
#include <amgcl/adapter/crs_tuple.hpp>

namespace amgcl {
#ifdef AMGCL_PROFILING
profiler<> prof;
#endif
}

namespace py = pybind11;

//---------------------------------------------------------------------------
boost::property_tree::ptree make_ptree(const py::dict &args) {
    boost::property_tree::ptree prm;
    for(auto p : args)
        prm.put(static_cast<std::string>(p.first.str()),
                static_cast<std::string>(p.second.str()));
    return prm;
}

//---------------------------------------------------------------------------
template <typename T>
{'fraction_non_alphanumeric': 0.28817204301075267, 'fraction_numerical': 0.010752688172043012, 'mean_word_length': 2.1703577512776833, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 33, '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': '4641623', 'n_tokens_mistral': 605, 'n_tokens_neox': 597, 'n_words': 113}