def _validate_index_level(self, level):
        if isinstance(level, int):
            if level < 0 and level != -1:
                raise IndexError("Too many levels: Index has only 1 level,"
                                 " %d is not a valid level number" % (level, ))
            elif level > 0:
                raise IndexError("Too many levels:"
                                 " Index has only 1 level, not %d" %
                                 (level + 1))
        elif level != self.name:
            raise KeyError('Level %s must be same as name (%s)' %
                           (level, self.name))
Executes a function per opcode in a job.
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index._validate_index_level--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_PerJobOpInner