code: def test_filter_unreachable(graph_file, source):
      G = graph_file.get_graph(
          create_using=cugraph.Graph(directed=True)
      )
      cu_M = G.view_edge_list()
  
      print("sources size = " + str(len(cu_M)))
      print("destinations size = " + str(len(cu_M)))
  
      print("cugraph Solving... ")
      t1 = time.time()
  
      df = cugraph.sssp(G, source)
  
      t2 = time.time() - t1
      print("Time : " + str(t2))
  
      reachable_df = cugraph.filter_unreachable(df)
  
      if np.issubdtype(df["distance"].dtype, np.integer):
          inf = np.iinfo(reachable_df["distance"].dtype).max
          assert len(reachable_df.query("distance == @inf")) == 0
      elif np.issubdtype(df["distance"].dtype, np.inexact):
          inf = np.finfo(
              reachable_df["distance"].dtype
          ).max  # noqa: F841
          assert len(reachable_df.query("distance == @inf")) == 0
  
      assert len(reachable_df) != 0
  
file_path: cugraph/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py
imports: import gc
  import time
  import pytest
  import numpy
  import networkx
  import cugraph
  from cugraph.testing import DEFAULT_DATASETS
label_desc: Use image node_id 2 for calling a global function with example usage: test_filter_unreachable(graph_file, source) without return types