def _parse_alfred_vis(self, data):
<EOL>graph = self._init_graph()<EOL>if '<STR_LIT>' in data:<EOL><INDENT>self.version = data['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise ParserError('<STR_LIT>')<EOL><DEDENT>node_list = self._get_aggregated_node_list(data['<STR_LIT>'])<EOL>for node in data["<STR_LIT>"]:<EOL><INDENT>for neigh in node["<STR_LIT>"]:<EOL><INDENT>graph.add_node(node['<STR_LIT>'], **{<EOL>'<STR_LIT>': node.get('<STR_LIT>', []),<EOL>'<STR_LIT>': node.get('<STR_LIT>', [])<EOL>})<EOL>primary_neigh = self._get_primary_address(neigh['<STR_LIT>'],<EOL>node_list)<EOL>graph.add_edge(node['<STR_LIT>'],<EOL>primary_neigh,<EOL>weight=float(neigh['<STR_LIT>']))<EOL><DEDENT><DEDENT>return graph<EOL>
Converts a alfred-vis JSON object
to a NetworkX Graph object which is then returned.
Additionally checks for "source_vesion" to determine the batman-adv version.