MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / parse_str

Function parse_str

lite/example/cpp_example/npy.h:274–280  ·  view source on GitHub ↗

Parses the string representation of a Python str */

Source from the content-addressed store, hash-verified

272 Parses the string representation of a Python str
273 */
274inline std::string parse_str(const std::string& in) {
275 if ((in.front() == '\'') && (in.back() == '\''))
276 return in.substr(1, in.length() - 2);
277
278 fprintf(stderr, "Invalid python string.");
279 return "";
280}
281
282/**
283 Parses the string represenatation of a Python tuple into a vector of its items

Callers 1

parse_headerFunction · 0.70

Calls 2

frontMethod · 0.80
backMethod · 0.80

Tested by

no test coverage detected