code: def from_ofxparse(data, institution):
          
  
          description = data.desc if hasattr(data, 'desc') else None
          if data.type == AccountType.Bank:
              return BankAccount(
                  institution=institution,
                  number=data.account_id,
                  routing_number=data.routing_number,
                  account_type=data.account_type,
                  description=description)
          elif data.type == AccountType.CreditCard:
              return CreditCardAccount(
                  institution=institution,
                  number=data.account_id,
                  description=description)
          elif data.type == AccountType.Investment:
              return BrokerageAccount(
                  institution=institution,
                  number=data.account_id,
                  broker_id=data.brokerid,
                  description=description)
          raise ValueError("unknown account type: %s" % data.type)
docs: Instantiate :py:class:`ofxclient.Account` subclass from ofxparse
          module
  
          :param data: an ofxparse account
          :type data: An :py:class:`ofxparse.Account` object
          :param institution: The parent institution of the account
          :type institution: :py:class:`ofxclient.Institution` object