code: def _bidirectional_shortest_path(
      G,
      source,
      target,
      ignore_nodes=None,
      ignore_edges=None,
      weight=None,
  ):
      """Returns the shortest path between source and target ignoring
         nodes and edges in the containers ignore_nodes and ignore_edges.
  
      This is a custom modification of the standard bidirectional shortest
      path implementation at networkx.algorithms.unweighted
  
      Parameters
      ----------
      G : NetworkX graph
  
      source : node
         starting node for path
  
      target : node
         ending node for path
  
      ignore_nodes : container of nodes
         nodes to ignore, optional
  
      ignore_edges : container of edges
         edges to ignore, optional
  
      weight : None
         This function accepts a weight argument for convenience of
         shortest_simple_paths function. It will be ignored.
  
      Returns
      -------
      path: list
         List of nodes in a path from source to target.
  
      Raises
      ------
      NetworkXNoPath
         If no path exists between source and target.
  
      See Also
      --------
      shortest_path
  
      """
      # call helper to do the real work
      results = _bidirectional_pred_succ(
          G, source, target, ignore_nodes, ignore_edges
      )
      pred, succ, w = results
  
      # build path from pred+w+succ
      path = []
      # from w to target
      while w is not None:
          path.append(w)
          w = succ[w]
      # from source to w
      w = pred[path[0]]
      while w is not None:
          path.insert(0, w)
          w = pred[w]
  
      return len(path), path
  
file_path: networkx/networkx/algorithms/simple_paths.py
imports: from heapq import heappop, heappush
  from itertools import count
  import networkx
  from networkx.algorithms.shortest_paths.weighted import _weight_function
  from networkx.utils import not_implemented_for, pairwise
label_desc: Use image node_id 6 for calling a global function with example usage: _bidirectional_shortest_path(G, source, target, ignore_nodes, ignore_edges, weight) and returns: len,  path