code: def find_entering_arc(
      pivot_block_size,
      pivot_next_arc,
      search_arc_num,
      state_vector,
      node_arc_data,
      in_arc,
  ):
      min = 0
      cnt = pivot_block_size
  
      # Pull from tuple for quick reference
      cost = node_arc_data.cost
      pi = node_arc_data.pi
      source = node_arc_data.source
      target = node_arc_data.target
  
      for e in range(pivot_next_arc, search_arc_num):
          c = state_vector[e] * (
              cost[e] + pi[source[e]] - pi[target[e]]
          )
          if c < min:
              min = c
              in_arc = e
  
          cnt -= 1
          if cnt == 0:
              if np.fabs(pi[source[in_arc]]) > np.fabs(
                  pi[target[in_arc]]
              ):
                  a = np.fabs(pi[source[in_arc]])
              else:
                  a = np.fabs(pi[target[in_arc]])
  
              if a <= np.fabs(cost[in_arc]):
                  a = np.fabs(cost[in_arc])
  
              if min < -(EPSILON * a):
                  pivot_next_arc = e
                  return in_arc, pivot_next_arc
              else:
                  cnt = pivot_block_size
  
      for e in range(pivot_next_arc):
          c = state_vector[e] * (
              cost[e] + pi[source[e]] - pi[target[e]]
          )
          if c < min:
              min = c
              in_arc = e
  
          cnt -= 1
          if cnt == 0:
              if np.fabs(pi[source[in_arc]]) > np.fabs(
                  pi[target[in_arc]]
              ):
                  a = np.fabs(pi[source[in_arc]])
              else:
                  a = np.fabs(pi[target[in_arc]])
  
              if a <= np.fabs(cost[in_arc]):
                  a = np.fabs(cost[in_arc])
  
              if min < -(EPSILON * a):
                  pivot_next_arc = e
                  return in_arc, pivot_next_arc
              else:
                  cnt = pivot_block_size
  
      # assert(pivot_block.next_arc[0] == 0 or e == pivot_block.next_arc[0] - 1)
  
      if np.fabs(pi[source[in_arc]]) > np.fabs(pi[target[in_arc]]):
          a = np.fabs(pi[source[in_arc]])
      else:
          a = np.fabs(pi[target[in_arc]])
  
      if a <= np.fabs(cost[in_arc]):
          a = np.fabs(cost[in_arc])
  
      if min >= -(EPSILON * a):
          return -1, 0
  
      return in_arc, pivot_next_arc
  
imports: import numpy
  import numba
  from collections import namedtuple
  from enum import Enum, IntEnum
label_desc: Use image node_id 2 for calling a global function with example usage: find_entering_arc(pivot_block_size, pivot_next_arc, search_arc_num, state_vector, node_arc_data, in_arc) and returns: in_arc,  pivot_next_arc, unknown,  int, in_arc,  pivot_next_arc, in_arc,  pivot_next_arc