code: def get_n_step_backup(rewards, pcontinues, state_values, start, n):
      """Evaluates a single n-step backup (return) starting at position start.
  
        http://incompleteideas.net/sutton/book/ebook/node73.html (Eq. 7.1)
  
      Args:
        rewards: a list containing a sequence of rewards.
        pcontinues: a list containing a sequence of discounts.
        state_values: a list containing a sequence of 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 the
            respective bootstrapped state-value.
  
      Returns:
        Sum of discounted rewards plus discounted bootstrapped value.
      """
      accumulator = 0.0
      k = 1.0
      for i in xrange(start, start + n):
          accumulator += k * rewards[i]
          k *= pcontinues[i]
      accumulator += k * state_values[start + n - 1]
      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 1 for calling a global function with example usage: get_n_step_backup(rewards, pcontinues, state_values, start, n) and returns: accumulator