code: def from_coo(
      cls,
      N: int,
      src_indices: cp.ndarray[IndexValue],
      dst_indices: cp.ndarray[IndexValue],
      edge_indices: cp.ndarray[IndexValue] | None = None,
      edge_values: dict[AttrKey, cp.ndarray[EdgeValue]] | None = None,
      edge_masks: dict[AttrKey, cp.ndarray[bool]] | None = None,
      node_values: dict[AttrKey, any_ndarray[NodeValue]] | None = None,
      node_masks: dict[AttrKey, any_ndarray[bool]] | None = None,
      *,
      key_to_id: dict[NodeKey, IndexValue] | None = None,
      id_to_key: list[NodeKey] | None = None,
      edge_keys: list[EdgeKey] | None = None,
      **attr,
  ) -> MultiGraph:
      new_graph = super().from_coo(
          N,
          src_indices,
          dst_indices,
          edge_values,
          edge_masks,
          node_values,
          node_masks,
          key_to_id=key_to_id,
          id_to_key=id_to_key,
          **attr,
      )
      new_graph.edge_indices = edge_indices
      new_graph.edge_keys = edge_keys
      # Easy and fast sanity checks
      if (
          new_graph.edge_keys is not None
          and len(new_graph.edge_keys) != src_indices.size
      ):
          raise ValueError
      return new_graph
  
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import TYPE_CHECKING, ClassVar
  import cupy
  import networkx
  import numpy
  import nx_cugraph
  from ..utils import index_dtype
  from .graph import Graph
label_desc: Use image node_id 1 for calling the MultiGraph obj's underlying member method code with example usage: obj.from_coo(cls, N, src_indices, dst_indices, edge_indices, edge_values, edge_masks, node_values, node_masks) and returns: new_graph