def get_backups(self, job):
        """Return a dict of backups that exist for the given job, by
        parsing the list of archives.
        """
        # Assemble regular expressions that matche the job's target
        # filenames, including those based on it's aliases.
        unique = uuid.uuid4().hex
        regexes = []
        for possible_name in [job.name] + (job.aliases or []):
            target = Template(job.target).substitute(
                {'name': possible_name, 'date': unique})
            regexes.append(re.compile("^%s$" %
                        re.escape(target).replace(unique, '(?P<date>.*?)')))

        backups = {}
        for backup_path in self.get_archives():
            match = None
            for regex in regexes:
                match = regex.match(backup_path)
                if match:
                    break
            else:
                # Not one of the regexes matched.
                continue
            try:
                date = parse_date(match.groupdict()['date'], job.dateformat)
            except ValueError, e:
                # This can occasionally happen when multiple archives
                # share a prefix, say for example you have "windows-$date"
                # and "windows-data-$date". Since we have to use a generic
                # .* regex to capture the date part, when processing the
                # "windows-$date" targets, we'll stumble over entries where
                # we try to parse "data-$date" as a date. Make sure we
                # only print a warning, rather than crashing.
                # TODO: It'd take some work, but we could build a proper
                # regex based on any given date format string, thus avoiding
                # the issue for most cases.
                self.log.error((backup_path, e) % "Ignoring '%s': %s")
            else:
                backups[backup_path] = date

        return backups
dataset/ETHPy150Open miracle2k/tarsnapper/src/tarsnapper/script.py/TarsnapBackend.get_backups/swapped operands of `%`