<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _linearize(cls, inst_list):
 """ A generator function which performs linearization of the list of instructions; that is, each instruction which should be executed will be yielded in turn, recursing into ``Instructions`` instances that appear in the list. :param inst_list: A list (or other sequence) of instructions. :returns: An iterator which returns all instructions. """


        for inst in inst_list:
            # Check if we need to recurse
            if isinstance(inst, Instructions):
                for sub_inst in cls._linearize(inst.instructions):
                    yield sub_inst
            else:
                yield inst