class_docstr: Duck-typed version of PyG's GraphStore and FeatureStore.
class_docstr_tok: ["Duck-typed","version","of","PyG","'s","GraphStore","and","FeatureStore","."]
docstr: Returns the edge index in the requested format
  (as defined by attr).  Currently, only unsorted
  COO is supported, which is returned as a (src,dst)
  tuple as expected by the PyG API.
  
  Parameters
  ----------
  attr: CuGraphEdgeAttr
      The CuGraphEdgeAttr specifying the
      desired edge type, layout (i.e. CSR, COO, CSC), and
      whether the returned index should be sorted (if COO).
      Currently, only unsorted COO is supported.
  
  Returns
  -------
  (src, dst) : Tuple[tensor type]
      Tuple of the requested edge index in COO form.
      Currently, only COO form is supported.
docstr_tok: ["Returns","the","edge","index","in","the","requested","format","(","as","defined","by","attr",")",".","Currently",",","only","unsorted","COO","is","supported",",","which","is","returned","as","a","(","src",",","dst",")","tuple","as","expected","by","the","PyG","API",".","Parameters","--","--","--","--","--","attr",":","CuGraphEdgeAttr","The","CuGraphEdgeAttr","specifying","the","desired","edge","type",",","layout","(","i.e",".","CSR",",","COO",",","CSC",")",",","and","whether","the","returned","index","should","be","sorted","(","if","COO",")",".","Currently",",","only","unsorted","COO","is","supported",".","Returns","--","--","--","-","(","src",",","dst",")",":","Tuple","[","tensor","type","]","Tuple","of","the","requested","edge","index","in","COO","form",".","Currently",",","only","COO","form","is","supported","."]
code: def _get_edge_index(
      self, attr: CuGraphEdgeAttr
  ) -> Tuple[TensorType, TensorType]:
      """
      Returns the edge index in the requested format
      (as defined by attr).  Currently, only unsorted
      COO is supported, which is returned as a (src,dst)
      tuple as expected by the PyG API.
  
      Parameters
      ----------
      attr: CuGraphEdgeAttr
          The CuGraphEdgeAttr specifying the
          desired edge type, layout (i.e. CSR, COO, CSC), and
          whether the returned index should be sorted (if COO).
          Currently, only unsorted COO is supported.
  
      Returns
      -------
      (src, dst) : Tuple[tensor type]
          Tuple of the requested edge index in COO form.
          Currently, only COO form is supported.
      """
  
      if self.__graph is None:
          raise ValueError(
              "Graph is not in memory, cannot access edge index!"
          )
  
      if attr.layout != EdgeLayout.COO:
          # TODO support returning CSR/CSC (Issue #3802)
          raise TypeError("Only COO direct access is supported!")
  
      # Currently, graph creation enforces that input vertex ids are always of
      # integer type.  Therefore, it is currently safe to assume that for MG
      # graphs, the src/dst col names are renumbered_src/dst
      # and for SG graphs, the src/dst col names are src/dst.
      # This may change in the future if/when renumbering or the graph
      # creation process is refactored.
      # See Issue #3201 for more details.
      # Also note src/dst are flipped so that cuGraph sampling is done in
      # CSC format rather than CSR format.
      if self._is_delayed:
          dst_col_name = (
              self.__graph.renumber_map.renumbered_src_col_name
          )
          src_col_name = (
              self.__graph.renumber_map.renumbered_dst_col_name
          )
      else:
          dst_col_name = self.__graph.srcCol
          src_col_name = self.__graph.dstCol
  
      # If there is only one edge type (homogeneous graph) then
      # bypass the edge filters for a significant speed improvement.
      if len(self.__edge_types_to_attrs) == 1:
          if attr.edge_type not in self.__edge_types_to_attrs:
              raise ValueError(
                  f"Requested edge type {attr.edge_type}"
                  "is not present in graph."
              )
  
          df = self.__graph.edgelist.edgelist_df[
              [src_col_name, dst_col_name]
          ]
          src_offset = 0
          dst_offset = 0
      else:
          src_type, _, dst_type = attr.edge_type
          src_offset = int(
              self.__vertex_type_offsets["start"][
                  self._numeric_vertex_type_from_name(src_type)
              ]
          )
          dst_offset = int(
              self.__vertex_type_offsets["start"][
                  self._numeric_vertex_type_from_name(dst_type)
              ]
          )
          coli = np.searchsorted(
              self.__edge_type_offsets["type"],
              "__".join(attr.edge_type),
          )
  
          df = self.__graph.edgelist.edgelist_df[
              [src_col_name, dst_col_name, self.__graph.edgeTypeCol]
          ]
          df = df[df[self.__graph.edgeTypeCol] == coli]
          df = df[[src_col_name, dst_col_name]]
  
      if self._is_delayed:
          df = df.compute()
  
      src = (
          torch.as_tensor(df[src_col_name], device="cuda") - src_offset
      )
      dst = (
          torch.as_tensor(df[dst_col_name], device="cuda") - dst_offset
      )
  
      src = src.to(self.__vertex_dtype)
      dst = dst.to(self.__vertex_dtype)
  
      if src.shape[0] != dst.shape[0]:
          raise IndexError("src and dst shape do not match!")
  
      return (src, dst)
  
imports: from typing import Optional, Tuple, Any, Union, List, Dict
  from enum import Enum, auto
  from dataclasses import dataclass
  from collections import defaultdict
  from itertools import chain
  from functools import cached_property
  import numpy
  import cupy
  import pandas
  import cudf
  import cugraph
  import warnings
  import dask.array
  import dask.dataframe
  import dask.distributed
  import dask_cudf
  from cugraph.utilities.utils import import_optional, MissingModule
label_desc: Use image node_id 18 for calling the CuGraphStore obj's underlying member method code with example usage: obj._get_edge_index(attr) and returns: src,  dst