original_docstring: 
      This function checks whether a path exists between two nodes (node1,
      node2) in graph G.
      
docstring: This function checks whether a path exists between two nodes (node1,
  node2) in graph G.
docstring_tokens: This function checks whether a path exists between two nodes ( node1 node2 ) in graph G .
code: def path_exists(node1, node2, G):
      """
      This function checks whether a path exists between two nodes (node1,
      node2) in graph G.
      """
  
      visited_nodes = set()
      queue = [node1]
  
      while len(queue) > 0:
          node = queue.pop()
          neighbors = list(G.neighbors(node))
          if node2 in neighbors:
              return True
          else:
              visited_nodes.add(node)
              nbrs = [n for n in neighbors if n not in visited_nodes]
              queue = nbrs + queue
  
      return False
code_tokens: def path_exists ( node1 , node2 , G ) : visited_nodes = set ( ) queue = [ node1 ] while len ( queue ) > 0 : node = queue . pop ( ) neighbors = list ( G . neighbors ( node ) ) if node2 in neighbors : return True else : visited_nodes . add ( node ) nbrs = [ n for n in neighbors if n not in visited_nodes ] queue = nbrs + queue return False
short_docstring: This function checks whether a path exists between two nodes (node1,
  node2) in graph G.
short_docstring_tokens: This function checks whether a path exists between two nodes ( node1 node2 ) in graph G .
comment: """
      This function checks whether a path exists between two nodes (node1,
      node2) in graph G.
      """