code: def descendants_at_distance(G, source, distance):
      """Returns all nodes at a fixed `distance` from `source` in `G`.
  
      Parameters
      ----------
      G : NetworkX graph
          A graph
      source : node in `G`
      distance : the distance of the wanted nodes from `source`
  
      Returns
      -------
      set()
          The descendants of `source` in `G` at the given `distance` from `source`
  
      Examples
      --------
      >>> G = nx.path_graph(5)
      >>> nx.descendants_at_distance(G, 2, 2)
      {0, 4}
      >>> H = nx.DiGraph()
      >>> H.add_edges_from([(0, 1), (0, 2), (1, 3), (1, 4), (2, 5), (2, 6)])
      >>> nx.descendants_at_distance(H, 0, 2)
      {3, 4, 5, 6}
      >>> nx.descendants_at_distance(H, 5, 0)
      {5}
      >>> nx.descendants_at_distance(H, 5, 1)
      set()
      """
      if source not in G:
          raise nx.NetworkXError(
              f"The node {source} is not in the graph."
          )
  
      bfs_generator = nx.bfs_layers(G, source)
      for i, layer in enumerate(bfs_generator):
          if i == distance:
              return set(layer)
      return set()
  
file_path: networkx/networkx/algorithms/traversal/breadth_first_search.py
imports: import math
  from collections import deque
  import networkx
label_desc: Use image node_id 8 for calling a global function with example usage: descendants_at_distance(G, source, distance) and returns: set, set