code: def test_from_networkx_group_attrs():
      x = torch.randn(2, 2)
      x1 = torch.randn(2, 4)
      x2 = torch.randn(2, 8)
      edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
      edge_attr1 = torch.randn(edge_index.size(1))
      edge_attr2 = torch.randn(edge_index.size(1))
      perm = torch.tensor([0, 2, 1])
      data = Data(
          x=x,
          x1=x1,
          x2=x2,
          edge_index=edge_index,
          edge_attr1=edge_attr1,
          edge_attr2=edge_attr2,
      )
      G = to_networkx(
          data,
          node_attrs=["x", "x1", "x2"],
          edge_attrs=["edge_attr1", "edge_attr2"],
      )
      data = from_networkx(
          G, group_node_attrs=["x", "x2"], group_edge_attrs=all
      )
      assert len(data) == 4
      assert data.x.tolist() == torch.cat([x, x2], dim=-1).tolist()
      assert data.x1.tolist() == x1.tolist()
      assert data.edge_index.tolist() == edge_index[:, perm].tolist()
      assert (
          data.edge_attr.tolist()
          == torch.stack([edge_attr1, edge_attr2], dim=-1)[
              perm
          ].tolist()
      )
  
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 9 for calling a global function with example usage: test_from_networkx_group_attrs() without return types