<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_instructions(self):
 """ Get the instructions :rtype: a generator of each :class:`Instruction` (or a cached list of instructions if you have setup instructions) """

        # it is possible to a cache for instructions (avoid a new disasm)
        if self.cached_instructions is None:
            lsa = LinearSweepAlgorithm()
            ins = lsa.get_instructions(self.CM, self.size, self.insn,
                                          self.idx)
            self.cached_instructions = list(ins)

        for i in self.cached_instructions:
            yield i