code: def _list_to_nodearray(
      self, nodes: list[NodeKey]
  ) -> cp.ndarray[IndexValue]:
      if (key_to_id := self.key_to_id) is not None:
          nodes = [key_to_id[node] for node in nodes]
      return cp.array(nodes, dtype=index_dtype)
  
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 41 for calling the Graph obj's underlying member method code with example usage: obj._list_to_nodearray(nodes) and returns: cp