def METHOD_NAME(self):
    def _add_to_rows(rows, data, label):
        for shard_id in sorted(data.keys()):
            rows.extend([
                '{},{},{},{}'.format(shard_id, model.__name__, data[shard_id][model], label)
                for model in sorted(data[shard_id].keys())
            ])
    rows = []
    _add_to_rows(rows, self._expected_data, 'valid')
    _add_to_rows(rows, self._unexpected_data, 'INVALID')
    return '\n'.join(rows)