MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / parse_graph

Function parse_graph

easygraph/readwrite/gml.py:337–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335 return curr_token, dct
336
337 def parse_graph():
338 curr_token, dct = parse_kv(next(tokens))
339 if curr_token.category is not None: # EOF
340 unexpected(curr_token, "EOF")
341 if "graph" not in dct:
342 raise EasyGraphError("input contains no graph")
343 graph = dct["graph"]
344 if isinstance(graph, list):
345 raise EasyGraphError("input contains more than one graph")
346 return graph
347
348 tokens = tokenize()
349 graph = parse_graph()

Callers 1

parse_gml_linesFunction · 0.85

Calls 3

EasyGraphErrorClass · 0.90
parse_kvFunction · 0.85
unexpectedFunction · 0.85

Tested by

no test coverage detected