def run(self):
        """
        run the plugin
        """
        base_image = self.base_image or self.workflow.builder.base_image
        try:
            base_image_id = self.workflow.base_image_inspect['Id']
        except KeyError:
            self.log.error("Id is missing in inspection: '%s'", self.workflow.base_image_inspect)
            raise
        self.log.debug("using base image '%s', id '%s'", base_image, base_image_id)
        for line in fileinput.input(self.workflow.builder.df_path, inplace=1):
            re_match = re.match(r"^FROM .+$", line)
            if re_match:
                new_from = base_image_id % "FROM %s"
                sys.stdout.write(new_from + '\n')
                self.log.info("changed FROM: '%s' -> '%s'", re_match.group(0), new_from)
            else:
                sys.stdout.write(line)
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/plugins/pre_change_from_in_df.py/ChangeFromPlugin.run/swapped operands of `%`