code: def ratecurve_from_discounting_function(discount_fn, dtype=None):
      """Returns `RateCurve` object using the supplied function for discounting.
  
      Args:
        discount_fn: A python callable which takes a `DateTensor` as an input and
          returns the corresponding discount factor as an output.
        dtype: `tf.Dtype`. Optional input specifying the dtype of the real tensors
          and ops.
  
      Returns:
        An object of class `RateCurveFromDiscountingFunction` which uses the
        supplied function for discounting.
      """
  
      dtype = dtype or tf.constant(0.0).dtype
      pseudo_maturity_dates = dates.convert_to_date_tensor(
          [(2020, 1, 1)]
      )
      pseudo_rates = tf.convert_to_tensor([0.0], dtype=dtype)
      pseudo_valuation_date = dates.convert_to_date_tensor((2020, 1, 1))
  
      return RateCurveFromDiscountingFunction(
          pseudo_maturity_dates,
          pseudo_rates,
          pseudo_valuation_date,
          discount_fn,
          dtype,
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/rate_curve.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance.math.interpolation import linear
label_desc: Use image node_id 1 for calling a global function with example usage: ratecurve_from_discounting_function(discount_fn, dtype) and returns: RateCurveFromDiscountingFunction