def serialize(self):
data = {<EOL>'<STR_LIT>': self.local_id(),<EOL>'<STR_LIT>': self.institution.serialize(),<EOL>'<STR_LIT>': self.number,<EOL>'<STR_LIT:description>': self.description<EOL>}<EOL>if hasattr(self, '<STR_LIT>'):<EOL><INDENT>data['<STR_LIT>'] = self.broker_id<EOL><DEDENT>elif hasattr(self, '<STR_LIT>'):<EOL><INDENT>data['<STR_LIT>'] = self.routing_number<EOL>data['<STR_LIT>'] = self.account_type<EOL><DEDENT>return data<EOL>
Serialize predictably for use in configuration storage.

        Output look like this::

          {
            'local_id':       'string',
            'number':         'account num',
            'description':    'descr',
            'broker_id':      'may be missing - type dependent',
            'routing_number': 'may be missing - type dependent,
            'account_type':   'may be missing - type dependent,
            'institution': {
                # ... see :py:meth:`ofxclient.Institution.serialize`
            }
          }

        :rtype: nested dictionary