MCPcopy
hub / github.com/lutzroeder/netron / _split_docstring

Function _split_docstring

tools/sklearn_script.py:10–27  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

8
9
10def _split_docstring(value):
11 headers = {}
12 current_header = ""
13 current_lines = []
14 lines = value.split("\n")
15 index = 0
16 while index < len(lines):
17 if index + 1 < len(lines) and len(lines[index + 1].strip(" ")) > 0 and \
18 len(lines[index + 1].strip(" ").strip("-")) == 0:
19 headers[current_header] = current_lines
20 current_header = lines[index].strip(" ")
21 current_lines = []
22 index = index + 1
23 else:
24 current_lines.append(lines[index])
25 index = index + 1
26 headers[current_header] = current_lines
27 return headers
28
29def _update_description(schema, lines):
30 if len("".join(lines).strip(" ")) > 0:

Callers 1

_metadataFunction · 0.85

Calls 2

splitMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected