def _present(w_prime_star, w, w_backtrack):
 index = (-1)
 flag = 0
 for arr in w_backtrack:
  index += 1
  if (np.all((w_prime_star == arr[0])) and np.all((w == arr[1]))):
   flag += 1
   break
 if (not flag):
  return (-1)
 return index

def _present ( w_prime_star , w , w_backtrack ) : index = ( - 1 ) flag = 0 for arr in w_backtrack : index += 1 if ( np . all ( ( w_prime_star == arr [ 0 ] ) ) and np . all ( ( w == arr [ 1 ] ) ) ) : flag += 1 break if ( not flag ) : return ( - 1 ) return index
internal helper function to return index of in w_backtrack .