Return this network in NetworkX graph object.

        :return: Network as NetworkX graph object
17557
def to_networkx(self):
        
        return nx_util.to_networkx(self.session.get(self.__url).json())
1154000
def show_network(self, network, **_params):
        """"""
        return self.get(self.network_path % (network), params=_params)
448152
def get_subgraph_list(self):
        

        sgraph_objs = list()

        for sgraph in self.obj_dict['subgraphs']:
                obj_dict_list = self.obj_dict['subgraphs'][sgraph]
                sgraph_objs.extend(
                    [Subgraph(obj_dict=obj_d)
                     for obj_d in obj_dict_list])

        return sgraph_objs
1229414
def get_graphs_by_ids(self, network_ids: Iterable[int]) -> List[BELGraph]:
        """"""
        rv = [
            self.get_graph_by_id(network_id)
            for network_id in network_ids
        ]
        log.debug('returning graphs for network identifiers: %s', network_ids)
        return rv
106856
def to_graph(self):
        
        edges = set()
        for clause, target in self.edges_iter():
            for source, signature in clause:
                edges.add((source, target, signature))

        return Graph.from_tuples(edges)
524208
def network_get(auth=None, **kwargs):
    '''
    

    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.get_network(**kwargs)
1228380
def network_list(self):
        '''
        
        '''
        nt_ks = self.compute_conn
        return [network.__dict__ for network in nt_ks.networks.list()]
1077482
def as_dict(self):
        

        d = {"@module": self.__class__.__module__,
             "@class": self.__class__.__name__,
             "molecule": self.molecule.as_dict(),
             "graphs": json_graph.adjacency_data(self.graph)}

        return d
788393
def ips(self):
        
        if self._ips is None:
            self._ips = {}
            default_net = extract_data_from_inspect("default", self.net_settings)
            if default_net:
                self._ips["default"] = default_net
            # this can be None
            networks = self.inspect_data["NetworkSettings"]["Networks"]
            if networks:
                for network_name, network_data in networks.items():
                    self._ips[network_name] = extract_data_from_inspect(network_name, network_data)

        return self._ips
439281
def get_network():
    """"""
    meta = SoftLayer.MetadataManager()
    network_tables = []
    for network_func in [meta.public_network, meta.private_network]:
        network = network_func()

        table = formatting.KeyValueTable(['name', 'value'])
        table.align['name'] = 'r'
        table.align['value'] = 'l'
        table.add_row(['mac addresses',
                       formatting.listing(network['mac_addresses'],
                                          separator=',')])
        table.add_row(['router', network['router']])
        table.add_row(['vlans',
                       formatting.listing(network['vlans'], separator=',')])
        table.add_row(['vlan ids',
                       formatting.listing(network['vlan_ids'], separator=',')])
        network_tables.append(table)

    return network_tables
272206
def get_networks(network_id=None):
    """"""
    session = db.get_reader_session()
    with session.begin():
        model = models_v2.Network
        networks = session.query(model).filter(model.project_id != '')
        if network_id:
            networks = networks.filter(model.id == network_id)
    return networks.all()
457277
def get_digraph(ont, relations=None, writecache=False):
    
    digraph = networkx.MultiDiGraph()
    logging.info("Getting edges (may be cached)")
    for (s,p,o) in get_edges(ont):
        p = map_legacy_pred(p)
        if relations is None or p in relations:
            digraph.add_edge(o,s,pred=p)
    logging.info("Getting labels (may be cached)")
    for (n,label) in fetchall_labels(ont):
        digraph.add_node(n, **{'label':label})
    return digraph
581858
def get_network(self):
        
        props = self.get_chain_properties()
        chain_id = props["chain_id"]
        for k, v in known_chains.items():
            if v["chain_id"] == chain_id:
                return v
        raise exceptions.UnknownNetworkException(
            "Connecting to unknown network (chain_id: {})!".format(props["chain_id"])
        )
398050
def network(n):
    
    tpm(n.tpm)
    connectivity_matrix(n.cm)
    if n.cm.shape[0] != n.size:
        raise ValueError("Connectivity matrix must be NxN, where N is the "
                         "number of nodes in the network.")
    return True
804868
def repr_tree(self):
        
        import utool as ut
        import networkx as nx
        repr_tree = nx.DiGraph()
        for u, v in ut.itertwo(self.values()):
            if not repr_tree.has_edge(v, u):
                repr_tree.add_edge(u, v)
        return repr_tree
887882
def get_config(self):
        
        self.update_network_description()
        result = dict(self.__dict__)
        result['_network'] = None
        result['network_weights'] = None
        result['network_weights_loader'] = None
        result['prediction_cache'] = None
        return result
743803
def to_networkx(cyjs, directed=True):
    

    if directed:
        g = nx.MultiDiGraph()
    else:
        g = nx.MultiGraph()

    network_data = cyjs[DATA]
    if network_data is not None:
        for key in network_data.keys():
            g.graph[key] = network_data[key]

    nodes = cyjs[ELEMENTS][NODES]
    edges = cyjs[ELEMENTS][EDGES]

    for node in nodes:
        data = node[DATA]
        g.add_node(data[ID], attr_dict=data)

    for edge in edges:
        data = edge[DATA]
        source = data[SOURCE]
        target = data[TARGET]

        g.add_edge(source, target, attr_dict=data)

    return g