code: def update_flow(
      join, leaving_arc_data, node_arc_data, spanning_tree, in_arc
  ):
      source = node_arc_data.source
      target = node_arc_data.target
      flow = node_arc_data.flow
  
      state = spanning_tree.state
      pred = spanning_tree.pred
      parent = spanning_tree.parent
      forward = spanning_tree.forward
  
      # Augment along the cycle
      if leaving_arc_data.delta > 0:
          val = state[in_arc] * leaving_arc_data.delta
          flow[in_arc] += val
          u = source[in_arc]
          while u != join:
              if forward[u]:
                  flow[pred[u]] -= val
              else:
                  flow[pred[u]] += val
  
              u = parent[u]
  
          u = target[in_arc]
          while u != join:
              if forward[u]:
                  flow[pred[u]] += val
              else:
                  flow[pred[u]] -= val
  
              u = parent[u]
  
      # Update the state of the entering and leaving arcs
      if leaving_arc_data.change:
          state[in_arc] = ArcState.STATE_TREE
          if flow[pred[leaving_arc_data.u_out]] == 0:
              state[pred[leaving_arc_data.u_out]] = ArcState.STATE_LOWER
          else:
              state[pred[leaving_arc_data.u_out]] = ArcState.STATE_UPPER
      else:
          state[in_arc] = -state[in_arc]
  
imports: import numpy
  import numba
  from collections import namedtuple
  from enum import Enum, IntEnum
label_desc: Use image node_id 5 for calling a global function with example usage: update_flow(join, leaving_arc_data, node_arc_data, spanning_tree, in_arc) without return types