def check_jump_targets(self, code):
    instructions = list(dis.get_instructions(code))
    targets = {instr.offset: instr for instr in instructions}
    for instr in instructions:
        if ('JUMP_' not in instr.opname):
            continue
        tgt = targets[instr.argval]
        if (tgt.opname in ('JUMP_ABSOLUTE', 'JUMP_FORWARD')):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')
        if ((instr.opname in ('JUMP_ABSOLUTE', 'JUMP_FORWARD')) and (tgt.opname == 'RETURN_VALUE')):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')
        if (('_OR_POP' in instr.opname) and ('JUMP_IF_' in tgt.opname)):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')
def check_jump_targets(self, code):
    instructions = list(dis.get_instructions(code))
    targets = {instr.offset: instr for instr in instructions}
    for instr in instructions:
        if ('JUMP_' not in instr.opname):
            continue
        tgt = targets[instr.argval]
        if (tgt.opname in ('JUMP_ABSOLUTE', 'JUMP_FORWARD')):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')
        if ((instr.opname in ('JUMP_ABSOLUTE', 'JUMP_FORWARD')) and (tgt.opname == 'RETURN_VALUE')):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')
        if (('_OR_POP' in instr.opname) and ('JUMP_IF_' in tgt.opname)):
            self.fail(f'{instr.opname} at {instr.offset} jumps to {tgt.opname} at {tgt.offset}')