def _parse_backup_log(self, filemap, number, client=None, agent=None):
        lookup_easy = {
            'start': r'^Start time: (.+)$',
            'end': r'^\s*End time: (.+)$',
            'duration': r'^Time taken: (.+)$',
            'totsize': r'^\s*Bytes in backup:\s+(\d+)',
            'received': r'^\s*Bytes received:\s+(\d+)'
        }
        lookup_complex = {
            'files': r'^\s*Files:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'files_enc': r'^\s*Files \(encrypted\):?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'dir': r'^\s*Directories:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'softlink': r'^\s*Soft links:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'hardlink': r'^\s*Hard links:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'meta': r'^\s*Meta data:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'meta_enc': r'^\s*Meta data\(enc\):?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'special': r'^\s*Special files:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'efs': r'^\s*EFS files:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'vssheader': r'^\s*VSS headers:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'vssheader_enc': r'^\s*VSS headers \(enc\):?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'vssfooter': r'^\s*VSS footers:?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'vssfooter_enc': r'^\s*VSS footers \(enc\):?\s+([\d\s]+)\s+\|\s+(\d+)$',
            'total': r'^\s*Grand total:?\s+([\d\s]+)\s+\|\s+(\d+)$'
        }
        _ = agent  # noqa
        backup = {'windows': 'false', 'number': int(number)}
        if client is not None:
            backup['name'] = client
        useful = False
        for line in filemap:
            if re.match(r'^\d{4}-\d{2}-\d{2} (\d{2}:){3} \w+\[\d+\] Client is Windows$', line):
                backup['windows'] = 'true'
            elif not useful and not re.match(r'^-+$', line):
                continue
            elif useful and re.match(r'^-+$', line):
                useful = False
                continue
            elif re.match(r'^-+$', line):
                useful = True
                continue

            found = False
            # this method is not optimal, but it is easy to read and to maintain
            for (key, regex) in iteritems(lookup_easy):
                reg = re.search(regex, line)
                if reg:
                    found = True
                    if key in ['start', 'end']:
                        backup[key] = int(time.mktime(datetime.datetime.strptime(reg.group(1), '%Y-%m-%d %H:%M:%S').timetuple()))
                    elif key == 'duration':
                        tmp = reg.group(1).split(':')
                        tmp.reverse()
                        fields = [0] * 4
                        for (i, val) in enumerate(tmp):
                            fields[i] = int(val)
                        seconds = 0
                        seconds += fields[0]
                        seconds += fields[1] * 60
                        seconds += fields[2] * (60 * 60)
                        seconds += fields[3] * (60 * 60 * 24)
                        backup[key] = seconds
                    else:
                        backup[key] = int(reg.group(1))
                    # break the loop as soon as we find a match
                    break

            # if found is True, we already parsed the line so we can jump to the next one
            if found:
                continue

            for (key, regex) in iteritems(lookup_complex):
                reg = re.search(regex, line)
                if reg:
                    # self._logger('debug', "match[1]: '{0}'".format(reg.group(1)))
                    spl = re.split(r'\s+', reg.group(1))
                    if len(spl) < 5:
                        return {}
                    backup[key] = {
                        'new': int(spl[0]),
                        'changed': int(spl[1]),
                        'unchanged': int(spl[2]),
                        'deleted': int(spl[3]),
                        'total': int(spl[4]),
                        'scanned': int(reg.group(2))
                    }
                    break
        return backup
The :func:`burpui.misc.backend.burp1.Burp._parse_backup_log` function
dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp1.py/Burp._parse_backup_log