code: def from_protos(
      proto_list: List[fra.ForwardRateAgreement],
      config: "ForwardRateAgreementConfig" = None,
  ) -> Dict[str, Any]:
      """Creates a dictionary of preprocessed swap data."""
      prepare_fras = {}
      for fra_proto in proto_list:
          short_position = fra_proto.short_position
          h, currency, rate_term, rate_index = _get_hash(fra_proto)
          fixing_date = fra_proto.fixing_date
          fixing_date = [
              fixing_date.year,
              fixing_date.month,
              fixing_date.day,
          ]
          notional_amount = instrument_utils.decimal_to_double(
              fra_proto.notional_amount
          )
          daycount_convention = daycount_conventions.from_proto_value(
              fra_proto.daycount_convention
          )
          business_day_convention = (
              business_days.convention_from_proto_value(
                  fra_proto.business_day_convention
              )
          )
          fixed_rate = instrument_utils.decimal_to_double(
              fra_proto.fixed_rate
          )
          calendar = business_days.holiday_from_proto_value(
              fra_proto.bank_holidays
          )
          settlement_days = fra_proto.settlement_days
          name = fra_proto.metadata.id
          instrument_type = fra_proto.metadata.instrument_type
          if h not in prepare_fras:
              prepare_fras[h] = {
                  "short_position": [short_position],
                  "currency": currency,
                  "fixing_date": [fixing_date],
                  "fixed_rate": [fixed_rate],
                  "notional_amount": [notional_amount],
                  "daycount_convention": daycount_convention,
                  "business_day_convention": business_day_convention,
                  "calendar": calendar,
                  "rate_term": rate_term,
                  "rate_index": rate_index,
                  "settlement_days": [settlement_days],
                  "config": config,
                  "batch_names": [[name, instrument_type]],
              }
          else:
              current_index = prepare_fras[h]["rate_index"]
              swap_utils.update_rate_index(current_index, rate_index)
              prepare_fras[h]["fixing_date"].append(fixing_date)
              prepare_fras[h]["short_position"].append(short_position)
              prepare_fras[h]["fixed_rate"].append(fixed_rate)
              prepare_fras[h]["notional_amount"].append(notional_amount)
              prepare_fras[h]["settlement_days"].append(settlement_days)
              prepare_fras[h]["batch_names"].append(
                  [name, instrument_type]
              )
      return prepare_fras
  
imports: from typing import Any, List, Dict, Tuple
  import tensorflow.compat.v2
  from tf_quant_finance.experimental.pricing_platform.framework import utils
  from tf_quant_finance.experimental.pricing_platform.framework.core import business_days
  from tf_quant_finance.experimental.pricing_platform.framework.core import currencies
  from tf_quant_finance.experimental.pricing_platform.framework.core import curve_types
  from tf_quant_finance.experimental.pricing_platform.framework.core import daycount_conventions
  from tf_quant_finance.experimental.pricing_platform.framework.core import rate_indices
  from tf_quant_finance.experimental.pricing_platform.framework.core import types
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import cashflow_streams
  from tf_quant_finance.experimental.pricing_platform.framework.rate_instruments import utils
  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 forward_rate_agreement_pb2
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import period_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: from_protos(proto_list, config) and returns: prepare_fras