def get_network_instances(self, name="<STR_LIT>"):
output = self._show_vrf()<EOL>vrfs = {}<EOL>all_vrf_interfaces = {}<EOL>for vrf in output:<EOL><INDENT>if (<EOL>vrf.get("<STR_LIT>", "<STR_LIT>") == "<STR_LIT>"<EOL>or vrf.get("<STR_LIT>", "<STR_LIT>") == "<STR_LIT:None>"<EOL>):<EOL><INDENT>vrf["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>vrf["<STR_LIT>"] = py23_compat.text_type(<EOL>vrf["<STR_LIT>"]<EOL>)<EOL><DEDENT>interfaces = {}<EOL>for interface_raw in vrf.get("<STR_LIT>", []):<EOL><INDENT>interface = interface_raw.split("<STR_LIT:U+002C>")<EOL>for line in interface:<EOL><INDENT>if line.strip() != "<STR_LIT>":<EOL><INDENT>interfaces[py23_compat.text_type(line.strip())] = {}<EOL>all_vrf_interfaces[py23_compat.text_type(line.strip())] = {}<EOL><DEDENT><DEDENT><DEDENT>vrfs[py23_compat.text_type(vrf["<STR_LIT:name>"])] = {<EOL>"<STR_LIT:name>": py23_compat.text_type(vrf["<STR_LIT:name>"]),<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT:state>": {"<STR_LIT>": vrf["<STR_LIT>"]},<EOL>"<STR_LIT>": {"<STR_LIT>": interfaces},<EOL>}<EOL><DEDENT>all_interfaces = self.get_interfaces_ip().keys()<EOL>vrfs["<STR_LIT:default>"] = {<EOL>"<STR_LIT:name>": "<STR_LIT:default>",<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT:state>": {"<STR_LIT>": "<STR_LIT>"},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": {<EOL>k: {} for k in all_interfaces if k not in all_vrf_interfaces.keys()<EOL>}<EOL>},<EOL>}<EOL>if name:<EOL><INDENT>if name in vrfs:<EOL><INDENT>return {py23_compat.text_type(name): vrfs[name]}<EOL><DEDENT>return {}<EOL><DEDENT>else:<EOL><INDENT>return vrfs<EOL><DEDENT>
get_network_instances implementation for EOS.