code: def calc_reward_multi_steps(df, multi_steps: int, gamma: float):
      # assumes df[reward] is array[float] and 1 <= len(df[reward]) <= multi_steps
      # computes r_0 + gamma * (r_1 + gamma * (r_2 + ... ))
      expr = f"AGGREGATE(REVERSE(reward), FLOAT(0), (s, x) -> FLOAT({gamma}) * s + x)"
      return calc_custom_reward(df, expr)
  
imports: import logging
  from typing import List, Optional, Tuple
  from pyspark.sql.functions import col, crc32, explode, map_keys, udf
  from pyspark.sql.types import ArrayType, BooleanType, FloatType, LongType, MapType, StructField, StructType
  from reagent.data.data_fetcher import DataFetcher
  from reagent.data.spark_utils import get_spark_session, get_table_url
  from reagent.workflow.types import Dataset, TableSpec
label_desc: Use image node_id 2 for calling a global function with example usage: calc_reward_multi_steps(df, multi_steps, gamma) and returns: calc_custom_reward