code: def _flatten_index(pos, grid_size):
      y_pos, x_pos = pos
      idx = grid_size * y_pos
      idx += x_pos
      return idx
  
imports: import copy
  from collections import Iterable
  import numpy
  from numba import jit, prange
  from numba.typed import List
  from ray.rllib.examples.env.coin_game_non_vectorized_env import CoinGame
  from ray.rllib.utils import override
label_desc: Use image node_id 4 for calling a global function with example usage: _flatten_index(pos, grid_size) and returns: idx