code: def from_scipy_sparse_matrix(
      A: scipy.sparse.spmatrix,
  ) -> Tuple[Tensor, Tensor]:
      r"""Converts a scipy sparse matrix to edge indices and edge attributes.
  
      Args:
          A (scipy.sparse): A sparse matrix.
  
      Examples:
          >>> edge_index = torch.tensor([
          ...     [0, 1, 1, 2, 2, 3],
          ...     [1, 0, 2, 1, 3, 2],
          ... ])
          >>> adj = to_scipy_sparse_matrix(edge_index)
          >>> # `edge_index` and `edge_weight` are both returned
          >>> from_scipy_sparse_matrix(adj)
          (tensor([[0, 1, 1, 2, 2, 3],
                  [1, 0, 2, 1, 3, 2]]),
          tensor([1., 1., 1., 1., 1., 1.]))
      """
      A = A.tocoo()
      row = torch.from_numpy(A.row).to(torch.long)
      col = torch.from_numpy(A.col).to(torch.long)
      edge_index = torch.stack([row, col], dim=0)
      edge_weight = torch.from_numpy(A.data)
      return edge_index, edge_weight
  
file_path: pytorch_geometric/torch_geometric/utils/convert.py
imports: from collections import defaultdict
  from typing import Any, Dict, Iterable, List, Literal, Optional, Tuple, Union
  import scipy.sparse
  import torch
  from torch import Tensor
  from torch.utils.dlpack import from_dlpack, to_dlpack
  import torch_geometric
  from torch_geometric.utils.num_nodes import maybe_num_nodes
label_desc: Use image node_id 2 for calling a global function with example usage: from_scipy_sparse_matrix(A) and returns: edge_index,  edge_weight