code: def test_to_dgl_graph():
      x = torch.randn(5, 3)
      edge_index = torch.tensor(
          [[0, 1, 1, 2, 3, 0], [1, 0, 2, 1, 4, 4]]
      )
      edge_attr = torch.randn(edge_index.size(1), 2)
      data = Data(x=x, edge_index=edge_index, edge_attr=edge_attr)
  
      g = to_dgl(data)
  
      assert torch.equal(data.x, g.ndata["x"])
      row, col = g.edges()
      assert torch.equal(row, edge_index[0])
      assert torch.equal(col, edge_index[1])
      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 26 for calling a global function with example usage: test_to_dgl_graph() without return types