@classmethod
    def parseInvestmentTransaction(cls_, ofx):
        transaction = InvestmentTransaction(ofx.name)
        tag = ofx.find('fitid')
        if (hasattr(tag, 'contents')):
            transaction.id = tag.contents[0].strip()
        tag = ofx.find('memo')
        if (hasattr(tag, 'contents')):
            transaction.memo = tag.contents[0].strip()
        tag = ofx.find('dttrade')
        if (hasattr(tag, 'contents')):
            try:
                transaction.tradeDate = cls_.parseOfxDateTime(
                    tag.contents[0].strip())
            except __HOLE__:
                raise
        tag = ofx.find('dtsettle')
        if (hasattr(tag, 'contents')):
            try:
                transaction.settleDate = cls_.parseOfxDateTime(
                    tag.contents[0].strip())
            except ValueError:
                raise
        tag = ofx.find('uniqueid')
        if (hasattr(tag, 'contents')):
            transaction.security = tag.contents[0].strip()
        tag = ofx.find('incometype')
        if (hasattr(tag, 'contents')):
            transaction.income_type = tag.contents[0].strip()
        tag = ofx.find('units')
        if (hasattr(tag, 'contents')):
            transaction.units = cls_.toDecimal(tag)
        tag = ofx.find('unitprice')
        if (hasattr(tag, 'contents')):
            transaction.unit_price = cls_.toDecimal(tag)
        tag = ofx.find('commission')
        if (hasattr(tag, 'contents')):
            transaction.commission = cls_.toDecimal(tag)
        tag = ofx.find('fees')
        if (hasattr(tag, 'contents')):
            transaction.fees = cls_.toDecimal(tag)
        tag = ofx.find('total')
        if (hasattr(tag, 'contents')):
            transaction.total = cls_.toDecimal(tag)
        tag = ofx.find('inv401ksource')
        if (hasattr(tag, 'contents')):
            transaction.inv401ksource = tag.contents[0].strip()
        return transaction
dataset/ETHPy150Open jseutter/ofxparse/ofxparse/ofxparse.py/OfxParser.parseInvestmentTransaction