code: def group_protos(
      proto_list: List[american_option_pb2.AmericanEquityOption],
      config: "AmericanOptionConfig" = None,
  ) -> Dict[str, List["AmericanOption"]]:
      """Creates a dictionary of grouped protos."""
      del config  # not used for now
      grouped_options = {}
      for american_option in proto_list:
          h, _ = _get_hash(american_option)
          if h in grouped_options:
              grouped_options[h].append(american_option)
          else:
              grouped_options[h] = [american_option]
      return grouped_options
  
file_path: tf-quant-finance/tf_quant_finance/experimental/pricing_platform/framework/equity_instruments/american_option/proto_utils.py
imports: from typing import Any, List, Dict, Tuple, Optional
  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 types
  from tf_quant_finance.experimental.pricing_platform.framework.equity_instruments 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 utils
  from tf_quant_finance.experimental.pricing_platform.instrument_protos import american_equity_option_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: group_protos(proto_list, config) and returns: grouped_options