code: def _create_curve_building_tensors(
      float_leg_start_times,
      float_leg_end_times,
      float_leg_daycount_fractions,
      fixed_leg_end_times,
      fixed_leg_cashflows,
      fixed_leg_daycount_fractions,
  ):
      """Helper function to create tensors needed for curve construction."""
      calc_float_leg_daycount = []
      float_leg_calc_times_start = []
      float_leg_calc_times_end = []
      calc_fixed_leg_cashflows = []
      calc_fixed_leg_daycount = []
      fixed_leg_calc_times = []
      calc_groups_float = []
      calc_groups_fixed = []
      last_float_leg_start_time = []
      last_float_leg_end_time = []
      last_float_leg_daycount = []
      last_fixed_leg_end_time = []
      last_fixed_leg_daycount = []
      last_fixed_leg_cashflows = []
      expiry_times = []
      num_instruments = len(float_leg_start_times)
      for i in range(num_instruments):
          calc_float_leg_daycount.append(
              float_leg_daycount_fractions[i][:-1]
          )
          float_leg_calc_times_start.append(
              float_leg_start_times[i][:-1]
          )
          float_leg_calc_times_end.append(float_leg_end_times[i][:-1])
          calc_fixed_leg_cashflows.append(fixed_leg_cashflows[i][:-1])
          calc_fixed_leg_daycount.append(
              fixed_leg_daycount_fractions[i][:-1]
          )
          fixed_leg_calc_times.append(fixed_leg_end_times[i][:-1])
          last_float_leg_start_time.append(float_leg_start_times[i][-1])
          last_float_leg_end_time.append(float_leg_end_times[i][-1])
          last_float_leg_daycount.append(
              float_leg_daycount_fractions[i][-1]
          )
          last_fixed_leg_end_time.append(fixed_leg_end_times[i][-1])
          last_fixed_leg_daycount.append(
              fixed_leg_daycount_fractions[i][-1]
          )
          last_fixed_leg_cashflows.append(fixed_leg_cashflows[i][-1])
          expiry_times.append(
              tf.math.maximum(
                  float_leg_end_times[i][-1], fixed_leg_end_times[i][-1]
              )
          )
  
          calc_groups_float.append(
              tf.fill(tf.shape(float_leg_start_times[i][:-1]), i)
          )
          calc_groups_fixed.append(
              tf.fill(tf.shape(fixed_leg_end_times[i][:-1]), i)
          )
  
      output = CurveFittingVars(
          float_leg_daycount=tf.concat(calc_float_leg_daycount, axis=0),
          float_leg_times_start=tf.concat(
              float_leg_calc_times_start, axis=0
          ),
          float_leg_times_end=tf.concat(
              float_leg_calc_times_end, axis=0
          ),
          fixed_leg_cashflows=tf.concat(
              calc_fixed_leg_cashflows, axis=0
          ),
          fixed_leg_daycount=tf.concat(calc_fixed_leg_daycount, axis=0),
          fixed_leg_calc_times=tf.concat(fixed_leg_calc_times, axis=0),
          settle_times_fixed=None,
          settle_times_float=None,
          expiry_times=tf.stack(expiry_times, axis=0),
          calc_groups_float=tf.concat(calc_groups_float, axis=0),
          calc_groups_fixed=tf.concat(calc_groups_fixed, axis=0),
          last_float_leg_start_time=tf.stack(
              last_float_leg_start_time, axis=0
          ),
          last_float_leg_end_time=tf.stack(
              last_float_leg_end_time, axis=0
          ),
          last_float_leg_daycount=tf.stack(
              last_float_leg_daycount, axis=0
          ),
          last_fixed_leg_calc_time=tf.stack(
              last_fixed_leg_end_time, axis=0
          ),
          last_fixed_leg_daycount=tf.stack(
              last_fixed_leg_daycount, axis=0
          ),
          last_fixed_leg_cashflows=tf.stack(
              last_fixed_leg_cashflows, axis=0
          ),
      )
  
      return output
  
file_path: tf-quant-finance/tf_quant_finance/rates/swap_curve_bootstrap.py
imports: from typing import List, Callable
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math.interpolation import linear
  from tf_quant_finance.rates import swap_curve_common
label_desc: Use image node_id 4 for calling a global function with example usage: _create_curve_building_tensors(float_leg_start_times, float_leg_end_times, float_leg_daycount_fractions, fixed_leg_end_times, fixed_leg_cashflows, fixed_leg_daycount_fractions) and returns: output