code: def get_discount_curve(
      discount_curve_types: List[
          Union[
              curve_types_lib.RiskFreeCurve,
              curve_types_lib.RateIndexCurve,
          ]
      ],
      market: pmd.ProcessedMarketData,
      mask: List[int],
  ) -> rate_curve.RateCurve:
      """Builds a batched discount curve.
  
      Given a list of discount curve an integer mask, creates a discount curve
      object to compute discount factors against the list of discount curves.
  
      #### Example
      ```none
      curve_types = [RiskFreeCurve("USD"), RiskFreeCurve("AUD")]
      # A mask to price a batch of 7 instruments with the corresponding discount
      # curves ["USD", "AUD", "AUD", "AUD" "USD", "USD", "AUD"].
      mask = [0, 1, 1, 1, 0, 0, 1]
      market = MarketDataDict(...)
      get_discount_curve(curve_types, market, mask)
      # Returns a RateCurve object that can compute a discount factors for a
      # batch of 7 dates.
      ```
  
      Args:
        discount_curve_types: A list of curve types.
        market: an instance of the processed market data.
        mask: An integer mask.
  
      Returns:
        An instance of `RateCurve`.
      """
      discount_curves = [
          market.yield_curve(curve_type)
          for curve_type in discount_curve_types
      ]
      discounts = []
      dates = []
      interpolation_method = None
      interpolate_rates = None
      for curve in discount_curves:
          discount, date = curve.discount_factors_and_dates()
          discounts.append(discount)
          dates.append(date)
          interpolation_method = curve.interpolation_method
          interpolate_rates = curve.interpolate_rates
  
      all_discounts = tf.stack(pad.pad_tensors(discounts), axis=0)
      all_dates = pad.pad_date_tensors(dates)
      all_dates = dateslib.DateTensor.stack(dates, axis=0)
      prepare_discounts = tf.gather(all_discounts, mask)
      prepare_dates = dateslib.dates_from_ordinals(
          tf.gather(all_dates.ordinal(), mask)
      )
      # All curves are assumed to have the same interpolation method
      # TODO(b/168411153): Extend to the case with multiple curve configs.
      discount_curve = rate_curve.RateCurve(
          prepare_dates,
          prepare_discounts,
          market.date,
          interpolator=interpolation_method,
          interpolate_rates=interpolate_rates,
      )
      return discount_curve
  
imports: from typing import Optional, Tuple, Callable, Any, List, Union
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance.experimental.pricing_platform.framework.core import curve_types
  from tf_quant_finance.experimental.pricing_platform.framework.core import processed_market_data
  from tf_quant_finance.experimental.pricing_platform.framework.core import types
  from tf_quant_finance.experimental.pricing_platform.framework.market_data import rate_curve
  from tf_quant_finance.experimental.pricing_platform.framework.market_data import utils
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import coupon_specs
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import period_pb2
  from tf_quant_finance.math import pad
label_desc: Use image node_id 2 for calling a global function with example usage: get_discount_curve(discount_curve_types, market, mask) and returns: discount_curve