def METHOD_NAME(network):
    r"""
    Write OpenPNM Network to a NetworkX object.
    Parameters
    ----------
    network : dict
        The OpenPNM Network to be converted to a NetworkX object
    Returns
    -------
    G : undirected graph object
        A NetworkX object with all pore/throat properties attached to it
    """
    import networkx as nx
    from openpnm.network import Network
    # Ensure network is an Network.
    if not isinstance(network, Network):  # pragma: no cover
        raise Exception('Provided network is not an OpenPNM Network.')
    G = nx.Graph()
    # Extracting node list and connectivity matrix from Network
    nodes = map(int, network.Ps)
    conns = network['throat.conns']
    # Explicitly add nodes and connectivity matrix
    G.add_nodes_from(nodes)
    G.add_edges_from(conns)
    # Attach Network properties to G
    for prop in network.props() + network.labels():
        if 'pore.' in prop:
            if len(network[prop].shape) > 1:
                val = {i: list(network[prop][i]) for i in network.Ps}
            else:
                val = {i: network[prop][i] for i in network.Ps}
            nx.set_node_attributes(G, name=prop[5:], values=val)
        if 'throat.' in prop:
            val = {tuple(conn): network[prop][i] for i, conn
                   in enumerate(conns)}
            nx.set_edge_attributes(G, name=prop[7:], values=val)
    return G