code: def expect(instr, expected, context):
      
      if not isinstance(instr, expected):
          raise DecompilationError(
              "Expected a {expected} instruction {context}. Got {instr}.".format(
                  instr=instr, expected=expected, context=context,
              )
          )
      return instr
docs: Check that an instruction is of the expected type.