code: def from_cugraph(g: Any) -> Tuple[Tensor, Optional[Tensor]]:
      r"""Converts a :obj:`cugraph` graph object into :obj:`edge_index` and
      optional :obj:`edge_weight` tensors.
  
      Args:
          g (cugraph.Graph): A :obj:`cugraph` graph object.
      """
      df = g.view_edge_list()
  
      src = from_dlpack(df[0].to_dlpack()).long()
      dst = from_dlpack(df[1].to_dlpack()).long()
      edge_index = torch.stack([src, dst], dim=0)
  
      edge_weight = None
      if "2" in df:
          edge_weight = from_dlpack(df["2"].to_dlpack())
  
      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 10 for calling a global function with example usage: from_cugraph(g) and returns: edge_index,  edge_weight