def delete_all(self, cond=None):
        """Delete all jobs and attachments"""
        if cond is None:
            cond = {}
        try:
            for d in self.jobs.find(spec=cond, fields=['_id', '_attachments']):
                logger.info(d['_id'] % 'deleting job %s')
                for name, file_id in d.get('_attachments', []):
                    try:
                        self.gfs.delete(file_id)
                    except gridfs.errors.NoFile:
                        logger.error('failed to remove attachment %s:%s' % (
                            name, file_id))
                self.jobs.remove(d)
        except pymongo.errors.OperationFailure, e:
            # -- translate pymongo error class into hyperopt error class
            #    see insert() code for rationale.
            raise OperationFailure(e)
dataset/ETHPy150Open hyperopt/hyperopt/hyperopt/mongoexp.py/MongoJobs.delete_all/swapped operands of `%`