def parse(self, data):
graph = self._init_graph()<EOL>for link in data.get_inner_links():<EOL><INDENT>if link.status != libcnml.libcnml.Status.WORKING:<EOL><INDENT>continue<EOL><DEDENT>interface_a, interface_b = link.getLinkedInterfaces()<EOL>source = interface_a.ipv4<EOL>dest = interface_b.ipv4<EOL>graph.add_edge(source, dest, weight=<NUM_LIT:1>)<EOL><DEDENT>return graph<EOL>
Converts a CNML structure to a NetworkX Graph object
which is then returned.