code: def _single_shortest_path_length(G, source, cutoff, kind):
      G = _to_graph(G)
      if source not in G:
          raise nx.NodeNotFound(f"{kind} {source} is not in G")
      if G.src_indices.size == 0:
          return {source: 0}
      if cutoff is None:
          cutoff = -1
      src_index = source if G.key_to_id is None else G.key_to_id[source]
      distances, predecessors, node_ids = plc.bfs(
          handle=plc.ResourceHandle(),
          graph=G._get_plc_graph(switch_indices=kind == "Target"),
          sources=cp.array([src_index], index_dtype),
          direction_optimizing=False,  # True for undirected only; what's recommended?
          depth_limit=cutoff,
          compute_predecessors=False,
          do_expensive_check=False,
      )
      mask = distances != np.iinfo(distances.dtype).max
      return G._nodearrays_to_dict(node_ids[mask], distances[mask])
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/algorithms/shortest_paths/unweighted.py
imports: import cupy
  import networkx
  import numpy
  import pylibcugraph
  from nx_cugraph.convert import _to_graph
  from nx_cugraph.utils import index_dtype, networkx_algorithm
label_desc: Use image node_id 3 for calling a global function with example usage: _single_shortest_path_length(G, source, cutoff, kind) and returns: G, dict