code: def get_complex_n_step_backup(
      rewards, pcontinues, state_values, start, n, lambda_
  ):
      """Evaluates a complex n=step backup (sum of lambda-weighted n-step backups).
  
        http://incompleteideas.net/sutton/book/ebook/node74.html (Eq. 7.3)
  
      Args:
        rewards: a list containing rewards.
        pcontinues: a list containing discounts.
        state_values: a list containing boostrapped state values.
        start: position at which the n-Step return has to be evaluated.
        n: number of steps over which rewards are summed before adding respective
            boostrapped state values.
        lambda_: mixing parameter lambda.
  
      Returns:
        A single complex backup.
      """
      accumulator = 0.0
      for t in xrange(1, n):
          value = get_n_step_backup(
              rewards, pcontinues, state_values, start, t
          )
          weight = (1 - lambda_) * (lambda_ ** (t - 1))
          accumulator += +value * weight
      value = get_n_step_backup(
          rewards, pcontinues, state_values, start, n
      )
      weight = lambda_ ** (n - 1)
      accumulator += value * weight
      return accumulator
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import xrange
  import tensorflow.compat.v1
  from trfl import sequence_ops
label_desc: Use image node_id 2 for calling a global function with example usage: get_complex_n_step_backup(rewards, pcontinues, state_values, start, n, lambda_) and returns: accumulator