def _flatten_action_profile(action_profile, indptr):
 N = (len(indptr) - 1)
 out = np.empty(indptr[(-1)])
 for i in range(N):
  if isinstance(action_profile[i], numbers.Integral):
   num_actions = (indptr[(i + 1)] - indptr[i])
   mixed_action = pure2mixed(num_actions, action_profile[i])
  else:
   mixed_action = action_profile[i]
  out[indptr[i]:indptr[(i + 1)]] = mixed_action
 return out

def _flatten_action_profile ( action_profile , indptr ) : N = ( len ( indptr ) - 1 ) out = np . empty ( indptr [ ( - 1 ) ] ) for i in range ( N ) : if isinstance ( action_profile [ i ] , numbers . Integral ) : num_actions = ( indptr [ ( i + 1 ) ] - indptr [ i ] ) mixed_action = pure2mixed ( num_actions , action_profile [ i ] ) else : mixed_action = action_profile [ i ] out [ indptr [ i ] : indptr [ ( i + 1 ) ] ] = mixed_action return out
flatten the given action profile .