code: def ancestors(G, source):
      return _ancestors_and_descendants(G, source, is_ancestors=True)
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/algorithms/dag.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: ancestors(G, source) and returns: _ancestors_and_descendants