code: def _get_plc_graph(
      self,
      edge_attr: AttrKey | None = None,
      edge_default: EdgeValue | None = None,
      edge_dtype: Dtype | None = None,
      *,
      store_transposed: bool = False,
      switch_indices: bool = False,
      edge_array: cp.ndarray[EdgeValue] | None = None,
      symmetrize: str | None = None,
  ):
      if edge_array is not None or edge_attr is None:
          pass
      elif edge_attr not in self.edge_values:
          if edge_default is None:
              raise KeyError(
                  "Graph has no edge attribute {edge_attr!r}"
              )
          # If we were given a default edge value, then it's probably okay to
          # use None for the edge_array if we don't have this edge attribute.
      elif edge_attr not in self.edge_masks:
          edge_array = self.edge_values[edge_attr]
      elif not self.edge_masks[edge_attr].all():
          if edge_default is None:
              raise NotImplementedError(
                  "Missing edge attributes is not yet implemented"
              )
          edge_array = cp.where(
              self.edge_masks[edge_attr],
              self.edge_values[edge_attr],
              edge_default,
          )
      else:
          # Mask is all True; don't need anymore
          del self.edge_masks[edge_attr]
          edge_array = self.edge_values[edge_attr]
      if edge_array is not None:
          if edge_dtype is not None:
              edge_dtype = np.dtype(edge_dtype)
              if edge_array.dtype != edge_dtype:
                  edge_array = edge_array.astype(edge_dtype)
          # PLC doesn't handle int edge weights right now, so cast int to float
          if edge_array.dtype in self._plc_type_map:
              if edge_array.dtype == np.int64:
                  if (val := edge_array.max().tolist()) > 2**53:
                      raise ValueError(
                          f"Integer value of value is too large (> 2**53): {val}; "
                          "pylibcugraph only supports float16 and float32 dtypes."
                      )
                  if (val := edge_array.min().tolist()) < -(2**53):
                      raise ValueError(
                          f"Integer value of value is small large (< -2**53): {val}; "
                          "pylibcugraph only supports float16 and float32 dtypes."
                      )
              elif (
                  edge_array.dtype == np.uint64
                  and edge_array.max().tolist() > 2**53
              ):
                  raise ValueError(
                      f"Integer value of value is too large (> 2**53): {val}; "
                      "pylibcugraph only supports float16 and float32 dtypes."
                  )
              # Consider warning here if we add algorithms that may
              # introduce roundoff errors when using floats as ints.
              edge_array = edge_array.astype(
                  self._plc_type_map[edge_array.dtype]
              )
          elif edge_array.dtype not in self._plc_allowed_edge_types:
              raise TypeError(edge_array.dtype)
      # Should we cache PLC graph?
      src_indices = self.src_indices
      dst_indices = self.dst_indices
      if switch_indices:
          src_indices, dst_indices = dst_indices, src_indices
      if symmetrize is not None:
          if edge_array is not None:
              raise NotImplementedError(
                  "edge_array must be None when symmetrizing the graph"
              )
          N = self._N
          # Upcast to int64 so indices don't overflow
          src_dst = N * src_indices.astype(np.int64) + dst_indices
          src_dst_T = src_indices + N * dst_indices.astype(np.int64)
          if symmetrize == "union":
              src_dst_new = cp.union1d(src_dst, src_dst_T)
          elif symmetrize == "intersection":
              src_dst_new = cp.intersect1d(src_dst, src_dst_T)
          else:
              raise ValueError(
                  f'symmetrize must be "union" or "intersection"; got "{symmetrize}"'
              )
          src_indices, dst_indices = cp.divmod(
              src_dst_new, N, dtype=index_dtype
          )
  
      return plc.SGGraph(
          resource_handle=plc.ResourceHandle(),
          graph_properties=plc.GraphProperties(
              is_multigraph=self.is_multigraph() and symmetrize is None,
              is_symmetric=not self.is_directed()
              or symmetrize is not None,
          ),
          src_or_offset_array=src_indices,
          dst_or_index_array=dst_indices,
          weight_array=edge_array,
          store_transposed=store_transposed,
          renumber=False,
          do_expensive_check=False,
          vertices_array=self._node_ids,
      )
  
imports: from __future__ import annotations
  import operator
  from copy import deepcopy
  from typing import TYPE_CHECKING
  import cupy
  import networkx
  import numpy
  import pylibcugraph
  import nx_cugraph
  from ..utils import index_dtype
label_desc: Use image node_id 35 for calling the Graph obj's underlying member method code with example usage: obj._get_plc_graph(edge_attr, edge_default, edge_dtype) and returns: plc