code: def _prepare_indices(idx0, idx1, idx2, idx3):
      """Prepare indices to get relevant slice from discount curve simulations."""
      len0 = idx0.shape.as_list()[0]
      len1 = idx1.shape.as_list()[0]
      len3 = idx3.shape.as_list()[0]
      idx0 = tf.repeat(idx0, len1 * len3)
      idx1 = tf.tile(tf.repeat(idx1, len3), [len0])
      idx2 = tf.tile(tf.repeat(idx2, len3), [len0])
      idx3 = tf.tile(idx3, [len0 * len1])
      return tf.stack([idx0, idx1, idx2, idx3], axis=-1)
  
imports: from typing import Callable, Tuple
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.models import utils
label_desc: Use image node_id 2 for calling a global function with example usage: _prepare_indices(idx0, idx1, idx2, idx3) and returns: tf