code: def test_to_networkx_undirected_options():
      import networkx as nx
  
      edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 0]])
      data = Data(edge_index=edge_index, num_nodes=3)
  
      G = to_networkx(data, to_undirected=True)
      assert nx.to_numpy_array(G).tolist() == [
          [0, 1, 1],
          [1, 0, 1],
          [1, 1, 0],
      ]
  
      G = to_networkx(data, to_undirected="upper")
      assert nx.to_numpy_array(G).tolist() == [
          [0, 1, 0],
          [1, 0, 1],
          [0, 1, 0],
      ]
  
      G = to_networkx(data, to_undirected="lower")
      assert nx.to_numpy_array(G).tolist() == [
          [0, 1, 1],
          [1, 0, 0],
          [1, 0, 0],
      ]
  
imports: import pytest
  import scipy.sparse
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.testing import get_random_edge_index, withPackage
  from torch_geometric.utils import from_cugraph, from_dgl, from_networkit, from_networkx, from_scipy_sparse_matrix, from_trimesh, sort_edge_index, subgraph, to_cugraph, to_dgl, to_networkit, to_networkx, to_scipy_sparse_matrix, to_trimesh
label_desc: Use image node_id 6 for calling a global function with example usage: test_to_networkx_undirected_options() without return types