MCPcopy Create free account
hub / github.com/bab2min/tomotopy / extract

Method extract

src/python/handler/py_label.cpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 py::UniqueObj extract(PyObject* arg)
77 {
78 auto tm = py::checkType<py::PObject<LDAModelObject>>(arg, "tm must be a tomotopy.LDAModel instance.");
79 auto cands = inst->extract(tm->value.inst.get());
80 py::UniqueObj ret = py::UniqueObj{ PyList_New(0) };
81 for (auto& c : cands)
82 {
83 auto item = py::makeNewObject<CandidateObject>();
84 item->tm = py::UniquePObj<LDAModelObject>{ tm };
85 item->tm.incref();
86 item->cand = move(c);
87 PyList_Append(ret.get(), (PyObject*)item.get());
88 }
89 return ret;
90 }
91};
92
93struct FoRelevanceObject : public py::CObject<FoRelevanceObject>

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
increfMethod · 0.45

Tested by

no test coverage detected