code: def get_previous_prompts(self, device):
          
          device_index = self.devices.index(device)
          prompts = [re.compile("(?!x)x")] + \
                    [dev.prompt_re for dev in self.devices[:device_index] if dev.prompt_re is not None]
          return prompts
docs: Return the list of intermediate prompts. All except target.