code: def has_edge(
      self, u: NodeKey, v: NodeKey, key: EdgeKey | None = None
  ) -> bool:
      if self.key_to_id is not None:
          try:
              u = self.key_to_id[u]
              v = self.key_to_id[v]
          except KeyError:
              return False
      mask = (self.src_indices == u) & (self.dst_indices == v)
      if key is None or (
          self.edge_indices is None and self.edge_keys is None
      ):
          return bool(mask.any())
      if self.edge_keys is None:
          try:
              return bool((mask & (self.edge_indices == key)).any())
          except TypeError:
              return False
      indices = cp.nonzero(mask)[0]
      if indices.size == 0:
          return False
      edge_keys = self.edge_keys
      return any(edge_keys[i] == key for i in indices.tolist())
  
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 16 for calling the MultiGraph obj's underlying member method code with example usage: obj.has_edge(u, v, key) and returns: any, bool, False, bool, False, False