| 11 | } |
| 12 | |
| 13 | std::string weight_to_string(py::object weight) { |
| 14 | py::object warn = py::module_::import("warnings").attr("warn"); |
| 15 | if (!py::isinstance<py::str>(weight)) { |
| 16 | if (!weight.is_none()) { |
| 17 | warn(py::str(weight) + py::str(" would be transformed into an instance of str.")); |
| 18 | } |
| 19 | weight = py::str(weight); |
| 20 | } |
| 21 | std::string weight_key = weight.cast<std::string>(); |
| 22 | return weight_key; |
| 23 | } |
| 24 | |
| 25 | py::object py_sum(py::object o) { |
| 26 | py::object sum = py::module_::import("builtins").attr("sum"); |
no outgoing calls
no test coverage detected