code: def build_flow_dict(G, R):
      """Build a flow dictionary from a residual network."""
      flow_dict = {}
      for u in G:
          flow_dict[u] = {v: 0 for v in G[u]}
          flow_dict[u].update(
              (v, attr["flow"])
              for v, attr in R[u].items()
              if attr["flow"] > 0
          )
      return flow_dict
  
file_path: networkx/networkx/algorithms/flow/utils.py
imports: from collections import deque
  import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: build_flow_dict(G, R) and returns: flow_dict