def preprocess(self):
super(MambuClient,self).preprocess()<EOL>try:<EOL><INDENT>for k,v in self['<STR_LIT>'].items():<EOL><INDENT>self[k] = v<EOL><DEDENT>del(self.attrs['<STR_LIT>'])<EOL><DEDENT>except Exception as e:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>self['<STR_LIT>'] = scrc(self['<STR_LIT>'], "<STR_LIT:U+0020>").strip()<EOL><DEDENT>except Exception as e:<EOL><INDENT>self['<STR_LIT>'] = "<STR_LIT>"<EOL><DEDENT>try:<EOL><INDENT>self['<STR_LIT>'] = scrc(self['<STR_LIT>'], "<STR_LIT:U+0020>").strip()<EOL><DEDENT>except Exception as ex:<EOL><INDENT>self['<STR_LIT>'] = "<STR_LIT>"<EOL><DEDENT>self['<STR_LIT>']      = scrc(self["<STR_LIT>"] + (("<STR_LIT:U+0020>" + self["<STR_LIT>"]) if self["<STR_LIT>"] != "<STR_LIT>" else "<STR_LIT>"), "<STR_LIT:U+0020>").strip()<EOL>self['<STR_LIT>']       = scrc(self['<STR_LIT>'], "<STR_LIT:U+0020>").strip()<EOL>self['<STR_LIT>']  = "<STR_LIT:U+0020>".join(self['<STR_LIT>'].split("<STR_LIT:U+0020>")[:-<NUM_LIT:1>]) if len(self['<STR_LIT>'].split("<STR_LIT:U+0020>")) > <NUM_LIT:1> else self['<STR_LIT>']<EOL>self['<STR_LIT>'] = "<STR_LIT:U+0020>".join(self['<STR_LIT>'].split("<STR_LIT:U+0020>")[-<NUM_LIT:1>:]) if len(self['<STR_LIT>'].split("<STR_LIT:U+0020>")) > <NUM_LIT:1> else "<STR_LIT>"<EOL>self['<STR_LIT:name>'] = scrc("<STR_LIT>" % (self['<STR_LIT>'], self['<STR_LIT>']), "<STR_LIT:U+0020>").strip()<EOL>self['<STR_LIT:address>'] = {}<EOL>try:<EOL><INDENT>for name,item in self['<STR_LIT>'][<NUM_LIT:0>].items():<EOL><INDENT>try:<EOL><INDENT>self['<STR_LIT>'][<NUM_LIT:0>][name] = item.strip()<EOL>self['<STR_LIT:address>'][name] = item.strip()<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>except (KeyError, IndexError):<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>for idDoc in self['<STR_LIT>']:<EOL><INDENT>self[idDoc['<STR_LIT>']] = idDoc['<STR_LIT>']<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>
Preprocessing.

        Flattens the object. Important data comes on the 'client'
        dictionary inside of the response. Instead, every element of the
        'client' dictionary is taken out to the main attrs dictionary.

        Removes repeated chars from firstName, middleName and lastName
        fields. Adds a firstLastName and secondLastName fields for
        clients using more than one last name.

        Adds a 'name' field joining all names in to one string. IMHO
        Mambu does an awful job with names. Besides, this is useful on
        loan accounts. They get a 'holder' field added somewhere, which
        may be an individual client, or a group. So to get the holder
        name, you just access the 'holder'['name']. No matter if you
        have a client loan or a group loan, you get the name of the
        holder.

        Creates and 'address' field that holds the very first address on
        the addresses field, to ease the use of the
        perhaps-current-or-most-important address of the client.

        Creates a field for each documentId type with the value of the
        documentId, to ease the use of docuemnt IDs. That way if you
        have a document Id named 'CURP', then you access it directly via
        the 'CURP' field, instead of going all the way through the
        idDocuments field.