code: def group_protos_v2(
      proto_list: List[ir_swap.InterestRateSwap],
      config: "InterestRateSwapConfig" = None,
  ) -> Dict[str, Any]:
      """Creates a dictionary of grouped protos."""
      del config  # config does not impact the batching
      grouped_swaps = {}
      for swap_proto in proto_list:
          h, _ = get_hash_v2(swap_proto)
          if h in grouped_swaps:
              grouped_swaps[h].append(swap_proto)
          else:
              grouped_swaps[h] = [swap_proto]
      return grouped_swaps
  
imports: from typing import Any, Dict, List, Tuple, Union
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  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.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 import utils
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import interest_rate_swap_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: group_protos_v2(proto_list, config) and returns: grouped_swaps