code: def test_from_dgl_graph():
      import dgl
  
      g = dgl.graph(([0, 0, 1, 5], [1, 2, 2, 0]))
      g.ndata["x"] = torch.randn(g.num_nodes(), 3)
      g.edata["edge_attr"] = torch.randn(g.num_edges())
  
      data = from_dgl(g)
  
      assert torch.equal(data.x, g.ndata["x"])
      row, col = g.edges()
      assert torch.equal(data.edge_index[0], row)
      assert torch.equal(data.edge_index[1], col)
      assert torch.equal(data.edge_attr, g.edata["edge_attr"])
  
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 29 for calling a global function with example usage: test_from_dgl_graph() without return types