class_docstr: Represents a batch of American Equity Options.
  
  An American equity option is a contract that gives the holder an opportunity
  to buy (call) or sell (put) an equity for a predefined value (strike) at
  any date before the expiry.
  
  The AmericanOption class can be used to create and price multiple options
  simultaneously.
  
  #### Example:
  The following example illustrates the construction of a batch of American
  options and pricing them.
  
  ```None
  american_option_proto = american_option_pb2.AmericanEquityOption(
      short_position=True,
      expiry_date=date_pb2.Date(year=2022, month=5, day=21),
      contract_amount=decimal_pb2.Decimal(units=10000),
      strike=decimal_pb2.Decimal(units=1500),
      equity="GOOG",
      currency=Currency.USD(),
      business_day_convention=BusinessDayConvention.MODIFIED_FOLLOWING(),
      is_call_option=False)
  
  market = market_data.MarketDataDict(...)
  am_option_portfolio = AmericanOption.from_protos([american_option_proto])
  am_option_portfolio[0].price(market)
  ```
class_docstr_tok: ["Represents","a","batch","of","American","Equity","Options",".","An","American","equity","option","is","a","contract","that","gives","the","holder","an","opportunity","to","buy","(","call",")","or","sell","(","put",")","an","equity","for","a","predefined","value","(","strike",")","at","any","date","before","the","expiry",".","The","AmericanOption","class","can","be","used","to","create","and","price","multiple","options","simultaneously",".","#","#","#","#","Example",":","The","following","example","illustrates","the","construction","of","a","batch","of","American","options","and","pricing","them",".","``","`","None","american_option_proto","=","american_option_pb2.AmericanEquityOption","(","short_position=True",",","expiry_date=date_pb2.Date","(","year=2022",",","month=5",",","day=21",")",",","contract_amount=decimal_pb2.Decimal","(","units=10000",")",",","strike=decimal_pb2.Decimal","(","units=1500",")",",","equity=","''","GOOG","''",",","currency=Currency.USD","(",")",",","business_day_convention=BusinessDayConvention.MODIFIED_FOLLOWING","(",")",",","is_call_option=False",")","market","=","market_data.MarketDataDict","(","...",")","am_option_portfolio","=","AmericanOption.from_protos","(","[","american_option_proto","]",")","am_option_portfolio","[","0","]",".price","(","market",")","``","`"]
docstr: Creates a dictionary to initialize AmericanEquityOption.
  
  The output dictionary is such that the instruments can be initialized
  as follows:
  ```
  initializer = create_constructor_args(proto_list, config)
  american_options = [AmericanEquityOption(**data)
                      for data in initializer.values()]
  ```
  
  The keys of the output dictionary are unique identifiers of the batched
  instruments. This is useful for identifying an existing graph that could be
  reused for the instruments without the need of rebuilding the graph.
  
  Args:
    proto_list: A list of protos for which the initialization arguments are
      constructed.
    config: An instance of `AmericanOptionConfig`.
  
  Returns:
    A possibly nested dictionary such that each value provides initialization
    arguments for the AmericanEquityOption.
docstr_tok: ["Creates","a","dictionary","to","initialize","AmericanEquityOption",".","The","output","dictionary","is","such","that","the","instruments","can","be","initialized","as","follows",":","``","`","initializer","=","create_constructor_args","(","proto_list",",","config",")","american_options","=","[","AmericanEquityOption","(","*","*","data",")","for","data","in","initializer.values","(",")","]","``","`","The","keys","of","the","output","dictionary","are","unique","identifiers","of","the","batched","instruments",".","This","is","useful","for","identifying","an","existing","graph","that","could","be","reused","for","the","instruments","without","the","need","of","rebuilding","the","graph",".","Args",":","proto_list",":","A","list","of","protos","for","which","the","initialization","arguments","are","constructed",".","config",":","An","instance","of","`","AmericanOptionConfig","`",".","Returns",":","A","possibly","nested","dictionary","such","that","each","value","provides","initialization","arguments","for","the","AmericanEquityOption","."]
code: def create_constructor_args(
      cls,
      proto_list: List[american_option_pb2.AmericanEquityOption],
      config: AmericanOptionConfig = None,
  ) -> Dict[str, Any]:
      """Creates a dictionary to initialize AmericanEquityOption.
  
      The output dictionary is such that the instruments can be initialized
      as follows:
      ```
      initializer = create_constructor_args(proto_list, config)
      american_options = [AmericanEquityOption(**data)
                          for data in initializer.values()]
      ```
  
      The keys of the output dictionary are unique identifiers of the batched
      instruments. This is useful for identifying an existing graph that could be
      reused for the instruments without the need of rebuilding the graph.
  
      Args:
        proto_list: A list of protos for which the initialization arguments are
          constructed.
        config: An instance of `AmericanOptionConfig`.
  
      Returns:
        A possibly nested dictionary such that each value provides initialization
        arguments for the AmericanEquityOption.
      """
      am_option_data = proto_utils.from_protos(proto_list, config)
      res = {}
      for key in am_option_data:
          tensor_repr = proto_utils.tensor_repr(am_option_data[key])
          res[key] = tensor_repr
      return res
  
imports: from typing import Any, Optional, List, Dict, Union, Tuple
  import dataclasses
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  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.equity_instruments import utils
  from tf_quant_finance.experimental.pricing_platform.framework.equity_instruments.american_option import proto_utils
  from tf_quant_finance.experimental.pricing_platform.framework.equity_instruments.american_option import utils
  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.instrument_protos import american_equity_option_pb2
label_desc: Use image node_id 2 for calling the AmericanOption obj's underlying member method code with example usage: obj.create_constructor_args(cls, proto_list, config) and returns: res