class_docstr: ``Contract(**kwargs)`` can create any contract using keyword
  arguments. To simplify working with contracts, there are also more
  specialized contracts that take optional positional arguments.
  Some examples::
  
      Contract(conId=270639)
      Stock('AMD', 'SMART', 'USD')
      Stock('INTC', 'SMART', 'USD', primaryExchange='NASDAQ')
      Forex('EURUSD')
      CFD('IBUS30')
      Future('ES', '20180921', 'GLOBEX')
      Option('SPY', '20170721', 240, 'C', 'SMART')
      Bond(secIdType='ISIN', secId='US03076KAA60')
      Crypto('BTC', 'PAXOS', 'USD')
  
  Args:
      conId (int): The unique IB contract identifier.
      symbol (str): The contract (or its underlying) symbol.
      secType (str): The security type:
  
          * 'STK' = Stock (or ETF)
          * 'OPT' = Option
          * 'FUT' = Future
          * 'IND' = Index
          * 'FOP' = Futures option
          * 'CASH' = Forex pair
          * 'CFD' = CFD
          * 'BAG' = Combo
          * 'WAR' = Warrant
          * 'BOND' = Bond
          * 'CMDTY' = Commodity
          * 'NEWS' = News
          * 'FUND' = Mutual fund
          * 'CRYPTO' = Crypto currency
          * 'EVENT' = Bet on an event
      lastTradeDateOrContractMonth (str): The contract's last trading
          day or contract month (for Options and Futures).
          Strings with format YYYYMM will be interpreted as the
          Contract Month whereas YYYYMMDD will be interpreted as
          Last Trading Day.
      strike (float): The option's strike price.
      right (str): Put or Call.
          Valid values are 'P', 'PUT', 'C', 'CALL', or '' for non-options.
      multiplier (str): The instrument's multiplier (i.e. options, futures).
      exchange (str): The destination exchange.
      currency (str): The underlying's currency.
      localSymbol (str): The contract's symbol within its primary exchange.
          For options, this will be the OCC symbol.
      primaryExchange (str): The contract's primary exchange.
          For smart routed contracts, used to define contract in case
          of ambiguity. Should be defined as native exchange of contract,
          e.g. ISLAND for MSFT. For exchanges which contain a period in name,
          will only be part of exchange name prior to period, i.e. ENEXT
          for ENEXT.BE.
      tradingClass (str): The trading class name for this contract.
          Available in TWS contract description window as well.
          For example, GBL Dec '13 future's trading class is "FGBL".
      includeExpired (bool): If set to true, contract details requests
          and historical data queries can be performed pertaining to
          expired futures contracts. Expired options or other instrument
          types are not available.
      secIdType (str): Security identifier type. Examples for Apple:
  
              * secIdType='ISIN', secId='US0378331005'
              * secIdType='CUSIP', secId='037833100'
      secId (str): Security identifier.
      comboLegsDescription (str): Description of the combo legs.
      comboLegs (List[ComboLeg]): The legs of a combined contract definition.
      deltaNeutralContract (DeltaNeutralContract): Delta and underlying
          price for Delta-Neutral combo orders.
class_docstr_tok: ["``","Contract","(","*","*","kwargs",")","``","can","create","any","contract","using","keyword","arguments",".","To","simplify","working","with","contracts",",","there","are","also","more","specialized","contracts","that","take","optional","positional","arguments",".","Some","examples",":",":","Contract","(","conId=270639",")","Stock","(","'AMD","'",",","'SMART","'",",","'USD","'",")","Stock","(","'INTC","'",",","'SMART","'",",","'USD","'",",","primaryExchange='NASDAQ","'",")","Forex","(","'EURUSD","'",")","CFD","(","'IBUS30","'",")","Future","(","'ES","'",",","'20180921","'",",","'GLOBEX","'",")","Option","(","'SPY","'",",","'20170721","'",",","240",",","'","C","'",",","'SMART","'",")","Bond","(","secIdType='ISIN","'",",","secId='US03076KAA60","'",")","Crypto","(","'BTC","'",",","'PAXOS","'",",","'USD","'",")","Args",":","conId","(","int",")",":","The","unique","IB","contract","identifier",".","symbol","(","str",")",":","The","contract","(","or","its","underlying",")","symbol",".","secType","(","str",")",":","The","security","type",":","*","'STK","'","=","Stock","(","or","ETF",")","*","'OPT","'","=","Option","*","'FUT","'","=","Future","*","'IND","'","=","Index","*","'FOP","'","=","Futures","option","*","'CASH","'","=","Forex","pair","*","'CFD","'","=","CFD","*","'BAG","'","=","Combo","*","'WAR","'","=","Warrant","*","'BOND","'","=","Bond","*","'CMDTY","'","=","Commodity","*","'NEWS","'","=","News","*","'FUND","'","=","Mutual","fund","*","'CRYPTO","'","=","Crypto","currency","*","'EVENT","'","=","Bet","on","an","event","lastTradeDateOrContractMonth","(","str",")",":","The","contract","'s","last","trading","day","or","contract","month","(","for","Options","and","Futures",")",".","Strings","with","format","YYYYMM","will","be","interpreted","as","the","Contract","Month","whereas","YYYYMMDD","will","be","interpreted","as","Last","Trading","Day",".","strike","(","float",")",":","The","option","'s","strike","price",".","right","(","str",")",":","Put","or","Call",".","Valid","values","are","'","P","'",",","'PUT","'",",","'","C","'",",","'CALL","'",",","or","``","for","non-options",".","multiplier","(","str",")",":","The","instrument","'s","multiplier","(","i.e",".","options",",","futures",")",".","exchange","(","str",")",":","The","destination","exchange",".","currency","(","str",")",":","The","underlying","'s","currency",".","localSymbol","(","str",")",":","The","contract","'s","symbol","within","its","primary","exchange",".","For","options",",","this","will","be","the","OCC","symbol",".","primaryExchange","(","str",")",":","The","contract","'s","primary","exchange",".","For","smart","routed","contracts",",","used","to","define","contract","in","case","of","ambiguity",".","Should","be","defined","as","native","exchange","of","contract",",","e.g",".","ISLAND","for","MSFT",".","For","exchanges","which","contain","a","period","in","name",",","will","only","be","part","of","exchange","name","prior","to","period",",","i.e",".","ENEXT","for","ENEXT.BE",".","tradingClass","(","str",")",":","The","trading","class","name","for","this","contract",".","Available","in","TWS","contract","description","window","as","well",".","For","example",",","GBL","Dec","'13","future","'s","trading","class","is","``","FGBL","''",".","includeExpired","(","bool",")",":","If","set","to","true",",","contract","details","requests","and","historical","data","queries","can","be","performed","pertaining","to","expired","futures","contracts",".","Expired","options","or","other","instrument","types","are","not","available",".","secIdType","(","str",")",":","Security","identifier","type",".","Examples","for","Apple",":","*","secIdType='ISIN","'",",","secId='US0378331005'","*","secIdType='CUSIP","'",",","secId='037833100'","secId","(","str",")",":","Security","identifier",".","comboLegsDescription","(","str",")",":","Description","of","the","combo","legs",".","comboLegs","(","List","[","ComboLeg","]",")",":","The","legs","of","a","combined","contract","definition",".","deltaNeutralContract","(","DeltaNeutralContract",")",":","Delta","and","underlying","price","for","Delta-Neutral","combo","orders","."]
docstr: Create and a return a specialized contract based on the given secType,
  or a general Contract if secType is not given.
docstr_tok: ["Create","and","a","return","a","specialized","contract","based","on","the","given","secType",",","or","a","general","Contract","if","secType","is","not","given","."]
code: def create(**kwargs) -> "Contract":
      """
      Create and a return a specialized contract based on the given secType,
      or a general Contract if secType is not given.
      """
      secType = kwargs.get("secType", "")
      cls = {
          "": Contract,
          "STK": Stock,
          "OPT": Option,
          "FUT": Future,
          "CONTFUT": ContFuture,
          "CASH": Forex,
          "IND": Index,
          "CFD": CFD,
          "BOND": Bond,
          "CMDTY": Commodity,
          "FOP": FuturesOption,
          "FUND": MutualFund,
          "WAR": Warrant,
          "IOPT": Warrant,
          "BAG": Bag,
          "CRYPTO": Crypto,
          "NEWS": Contract,
          "EVENT": Contract,
      }.get(secType, Contract)
      if cls is not Contract:
          kwargs.pop("secType", "")
      return cls(**kwargs)
  
imports: import datetime
  from dataclasses import dataclass, field
  from typing import List, NamedTuple, Optional
  import ib_insync.util
label_desc: Use image node_id 1 for calling the Contract obj's underlying member method code with example usage: obj.create() and returns: cls