def METHOD_NAME(self, network):
    try:
        import networkx as nx
    except ImportError:
        raise ImportError(
            f"You need to install the packages `networkx`." f"install networkx via `pip install networkx`."
        )
    self.E = nx.to_numpy_array(network)
    self.node_names = list(network.nodes)