code: def _prepare_indices_ijjk(idx0, idx1, idx2, idx3):
      """Prepares indices to get x[i, j, j, k]."""
      # For a 4-D `Tensor` x, creates indices for tf.gather_nd to retrieve
      # x[i, j, j, k].
      len0 = tf.shape(idx0)[0]
      len1 = tf.shape(idx1)[0]
      len3 = tf.shape(idx3)[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, Union
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance.math import pde
  from tf_quant_finance.math import random
  from tf_quant_finance.math.interpolation import linear
  from tf_quant_finance.math.root_search import brent
  from tf_quant_finance.models import utils
  from tf_quant_finance.models.hjm import swaption_util
  from tf_quant_finance.models.hull_white import one_factor
  from tf_quant_finance.models.hull_white import zero_coupon_bond_option
  from tf_quant_finance.models.longstaff_schwartz import lsm
label_desc: Use image node_id 5 for calling a global function with example usage: _prepare_indices_ijjk(idx0, idx1, idx2, idx3) and returns: tf