docs: def parent_images(self, parents):
          """
          setter for images in 'FROM' instructions.
          Images are updated per build stage with the given parents in the order they appear.
          Raises RuntimeError if a different number of parents are given than there are stages
          as that is likely to be a mistake.
  
          :param parents: list of image strings
          """
          parents = list(parents)
          change_instrs = []
          for instr in self.structure:
              if instr['instruction'] != 'FROM':
                  continue
  
              old_image, stage = image_from(instr['value'])
              if not old_image:
                  continue  # broken FROM, fixing would just confuse things
              if not parents:
                  raise RuntimeError("not enough parents to match build stages")
  
              image = parents.pop(0)
              if image != old_image:
                  instr['value'] = '{0} AS {1}'.format(image, stage) if stage else image
                  instr['content'] = 'FROM {0}\n'.format(instr['value'])
                  change_instrs.append(instr)
  
          if parents:
              raise RuntimeError("trying to update too many parents for build stages")
  
          lines = self.lines
          for instr in reversed(change_instrs):
              lines[instr['startline']:instr['endline']+1] = [instr['content']]
  
          self.lines = lines