code: def _get_unique_nodes(
      sampling_results: cudf.DataFrame,
      graph_store: CuGraphStore,
      node_type: str,
      node_position: str,
  ) -> int:
      """
      Counts the number of unique nodes of a given node type.
  
      Parameters
      ----------
      sampling_results: cudf.DataFrame
          The dataframe containing sampling results or filtered sampling results
          (i.e. sampling results for hop 2)
      graph_store: CuGraphStore
          The graph store containing the structure of the sampled graph.
      node_type: str
          The node type to count the number of unique nodes of.
      node_position: str ('src' or 'dst')
          Whether to examine source or destination nodes.
  
      Returns
      -------
      cudf.Series
          The unique nodes of the given node type.
      """
      if node_position == "src":
          edge_index = "majors"
          edge_sel = 0
      elif node_position == "dst":
          edge_index = "minors"
          edge_sel = -1
      else:
          raise ValueError(
              f"Illegal value {node_position} for node_position"
          )
  
      etypes = [
          graph_store.canonical_edge_type_to_numeric(et)
          for et in graph_store.edge_types
          if et[edge_sel] == node_type
      ]
      if len(etypes) > 0:
          f = sampling_results.edge_type == etypes[0]
          for et in etypes[1:]:
              f |= sampling_results.edge_type == et
  
          sampling_results_node = sampling_results[f]
      else:
          return cudf.Series([], dtype="int64")
  
      return sampling_results_node[edge_index]
  
file_path: cugraph/python/cugraph-pyg/cugraph_pyg/sampler/cugraph_sampler.py
imports: from typing import Sequence, Dict, Tuple
  from cugraph_pyg.data import CuGraphStore
  from cugraph.utilities.utils import import_optional
  import cudf
label_desc: Use image node_id 1 for calling a global function with example usage: _get_unique_nodes(sampling_results, graph_store, node_type, node_position) and returns: sampling_results_node, cudf