code: def test_to_scipy_sparse_matrix():
      edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
  
      adj = to_scipy_sparse_matrix(edge_index)
      assert isinstance(adj, scipy.sparse.coo_matrix) is True
      assert adj.shape == (2, 2)
      assert adj.row.tolist() == edge_index[0].tolist()
      assert adj.col.tolist() == edge_index[1].tolist()
      assert adj.data.tolist() == [1, 1, 1]
  
      edge_attr = torch.tensor([1.0, 2.0, 3.0])
      adj = to_scipy_sparse_matrix(edge_index, edge_attr)
      assert isinstance(adj, scipy.sparse.coo_matrix) is True
      assert adj.shape == (2, 2)
      assert adj.row.tolist() == edge_index[0].tolist()
      assert adj.col.tolist() == edge_index[1].tolist()
      assert adj.data.tolist() == edge_attr.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 1 for calling a global function with example usage: test_to_scipy_sparse_matrix() without return types