code: def from_protos(
      proto_list: List[swaption_proto.Swaption],
      config: "SwaptionConfig" = None,
  ) -> Dict[str, Any]:
      """Creates a dictionary of preprocessed swap data."""
      prepare_swaptions = {}
      for swaption_instance in proto_list:
          swap_instance = swaption_instance.swap
          expiry_date = swaption_instance.expiry_date
  
          # For swaptions lets use the same keys as the underlying swaps.
          h, _ = get_hash(swaption_instance)
          name = swaption_instance.metadata.id
          instrument_type = swaption_instance.metadata.instrument_type
          if h in prepare_swaptions:
              prepare_swaptions[h]["expiry_date"].append(expiry_date)
              prepare_swaptions[h]["swap"].append(swap_instance)
              prepare_swaptions[h]["batch_names"].append(
                  [name, instrument_type]
              )
          else:
              prepare_swaptions[h] = {
                  "expiry_date": [expiry_date],
                  "swap": [swap_instance],
                  "config": config,
                  "batch_names": [[name, instrument_type]],
              }
      return prepare_swaptions
  
imports: from typing import Any, Dict, List, Tuple
  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 swaption_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: from_protos(proto_list, config) and returns: prepare_swaptions