def _guess_backup_protocol(self, number, client):
        """The :func:`burpui.misc.backend.burp2.Burp._guess_backup_protocol`
        function helps you determine if the backup is protocol 2 or 1

        :param number: Backup number to work on
        :type number: int

        :param client: Client name to work on
        :type client: str

        :returns: 1 or 2
        """
        query = self.status('c:{0}:b:{1}:l:backup\n'.format(client, number))
        try:
            log = query['clients'][0]['backups'][0]['logs']['backup']
            for line in log:
                if re.search(r'Protocol: 2$', line):
                    return 2
        except __HOLE__ as e:
            # Assume protocol 1 in all cases unless explicitly found Protocol 2
            return 1
        return 1
dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp2.py/Burp._guess_backup_protocol