code: def _process_config(
      config: Union[InterestRateSwapConfig, Dict[str, Any], None]
  ) -> InterestRateSwapConfig:
      """Converts config to InterestRateSwapConfig."""
      if config is None:
          return InterestRateSwapConfig()
      if isinstance(config, InterestRateSwapConfig):
          return config
      if isinstance(config, dict):
          past_fixing = config.get("past_fixing", None)
          discounting_curve = config.get("discounting_curve", dict())
          return InterestRateSwapConfig(
              discounting_curve=discounting_curve,
              past_fixing=past_fixing,
          )
      else:
          raise ValueError(
              "Unknown type for InterestRateSwap `config`."
          )
  
imports: import copy
  from typing import List, Dict, Optional, Union, Any
  import dataclasses
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance import math
  from tf_quant_finance.experimental.pricing_platform.framework.core import curve_types
  from tf_quant_finance.experimental.pricing_platform.framework.core import instrument
  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 utils
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import cashflow_streams
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import coupon_specs
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments.interest_rate_swap import proto_utils
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import interest_rate_swap_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _process_config(config) and returns: InterestRateSwapConfig, config, InterestRateSwapConfig