def rename(self, mapping):
        """
        Rename fields

        :param mapping: a dict in the format {'oldkey1': 'newkey1', ...}
        """
        for old_key, new_key in mapping:
            self.dict[new_key] = self.dict[old_key]
            del self.dict[old_key]
def rename ( self , mapping ) : for old_key , new_key in mapping : self . dict [ new_key ] = self . dict [ old_key ] del self . dict [ old_key ]
Rename fields

        :param mapping: a dict in the format {'oldkey1': 'newkey1', ...}