'Returns instr if op is found, otherwise throws AssertionError'

def assertInBytecode(self, x, opname, argval=_UNSPECIFIED):

    for instr in dis.get_instructions(x):
        if (instr.opname == opname):
            if ((argval is _UNSPECIFIED) or (instr.argval == argval)):
                return instr
    disassembly = self.get_disassembly_as_string(x)
    if (argval is _UNSPECIFIED):
        msg = ('%s    not    found    in    bytecode:\n%s' % (opname, disassembly))
    else:
        msg = '(%s,%r)    not    found    in    bytecode:\n%s'
        msg = (msg % (opname, argval, disassembly))
    self.fail(msg)
