def check_files(self, files, start, end, checked_queue_put, hashes, ultra, cache_time, meta_data_cache):
        files_to_batch_check = []
        base_path_len = len(self.path)
        if not self.path.endswith(sep):
            base_path_len += 1
        gzip_cache_dir = self.get_gzip_dir()
        compressor_path = get_7zip_path()
        empty_meta_data = self._empty_meta_data
        get_cached_file_name = _get_cached_file_name

        while start < end:
            if self.stopped:
                checked_queue_put(None) # Make sure the waiting thread wakes up
                break

            abs_path = files[start]
            start += 1

            relative_path = abs_path[base_path_len:]

            try:
                file_stat = stat(abs_path)

                file_size = file_stat.st_size

                if not S_ISREG(file_stat.st_mode) or file_size <= 0: # Not a valid file
                    checked_queue_put(relative_path)
                    continue

                calculate_hash = update_meta_data = False
                file_time = max(file_stat.st_mtime, file_stat.st_ctime)
                if cache_time < file_time:
                    calculate_hash = True
                else:
                    old_meta_data = meta_data_cache.get(relative_path, empty_meta_data)
                    if file_size != old_meta_data['length']:
                        calculate_hash = True
                    else:
                        file_hash = old_meta_data['hash']
                        file_md5 = old_meta_data['md5']

                # Avoid compressing some files because they either already use 'deflate' or
                # because the browser needs them uncompressed
                if relative_path.split('.')[-1] not in self._do_not_compress:
                    deploy_file_name = (gzip_cache_dir, relative_path) % '%s/%s.gz'
                    do_compress = False
                    try:
                        file_stat = stat(deploy_file_name)
                        if file_stat.st_mtime < file_time:
                            do_compress = True
                        elif file_stat.st_size >= file_size:
                            deploy_file_name = abs_path
                    except error:
                        do_compress = True
                    if do_compress:
                        if compressor_path:
                            if ultra:
                                process = Popen([compressor_path,
                                                 'a', '-tgzip',
                                                 '-mx=9', '-mfb=257', '-mpass=15',
                                                 deploy_file_name, abs_path],
                                                stdout=PIPE, stderr=PIPE)
                            else:
                                process = Popen([compressor_path,
                                                 'a', '-tgzip',
                                                 deploy_file_name, abs_path],
                                                stdout=PIPE, stderr=PIPE)
                            update_meta_data = True

                            if calculate_hash:
                                calculate_hash = False
                                file_hash = hash_file_sha256(abs_path)
                            output, _ = process.communicate()
                            if process.poll():
                                self.stop('Error compressing file "%s": "%s".' % (relative_path, str(output)))
                                continue
                            else:
                                try:
                                    if stat(deploy_file_name).st_size >= file_size:
                                        deploy_file_name = abs_path
                                except error as e:
                                    self.stop('Error opening compressed file "%s": "%s".' % (deploy_file_name, str(e)))
                                    continue
                                file_md5 = hash_file_md5(deploy_file_name)
                        else:
                            # Compress with Python gzip, will warn that 7zip is preferred
                            cache_dir = dirname(deploy_file_name)
                            try:
                                makedirs(cache_dir)
                            except OSError as e:
                                if e.errno != EEXIST:
                                    self.stop('Error compressing file "%s": "%s".' % (relative_path, str(e)))
                                    continue
                            try:
                                with GzipFile(deploy_file_name, mode='wb', compresslevel=9) as gzipfile:
                                    with open(abs_path, 'rb') as f:
                                        gzipfile.write(f.read())
                            except IOError as e:
                                self.stop('Error compressing file "%s": "%s".' % (relative_path, str(e)))
                                continue
                            LOG.warning('Using Python for GZip compression, install 7zip for optimal performance')
                            update_meta_data = True
                            if calculate_hash:
                                calculate_hash = False
                                file_hash = hash_file_sha256(abs_path)
                            try:
                                if stat(deploy_file_name).st_size >= file_size:
                                    deploy_file_name = abs_path
                            except error as e:
                                self.stop('Error opening compressed file "%s": "%s".' % (deploy_file_name, str(e)))
                                continue
                            file_md5 = hash_file_md5(deploy_file_name)
                else:
                    deploy_file_name = abs_path

                if calculate_hash:
                    update_meta_data = True
                    if deploy_file_name == abs_path:
                        file_hash, file_md5 = hash_file_sha256_md5(abs_path)
                    else:
                        file_hash = hash_file_sha256(abs_path)
                        file_md5 = hash_file_md5(deploy_file_name)

                if get_cached_file_name(relative_path, file_hash, file_size) not in hashes:
                    file_item = (deploy_file_name, relative_path, file_size, file_hash, file_md5, file_time)
                    files_to_batch_check.append(file_item)
                    if len(files_to_batch_check) >= 10:
                        self.batch_check_files(files_to_batch_check, checked_queue_put)
                        files_to_batch_check = []

                elif update_meta_data:
                    checked_queue_put((relative_path, file_size, file_hash, file_md5, file_time))
                else:
                    checked_queue_put((relative_path, file_size, file_hash, file_time)) # Nothing to do

                file_stat = None

            except (error, IOError) as e:
                self.stop('Error opening file "%s": "%s".' % (relative_path, str(e)))
            except Exception as e:
                self.stop('Error checking file "%s": "%s".' % (relative_path, str(e)))

        if len(files_to_batch_check) > 0:
            try:
                self.batch_check_files(files_to_batch_check, checked_queue_put)
            except (HTTPError, SSLError, ValueError) as e:
                self.stop('Error checking files: "%s".' % str(e))
            except Exception as e:
                self.stop('Error checking files: "%s".' % str(e))
    # pylint: enable=R0914,R0915
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/lib/deploy.py/Deployment.check_files/swapped operands of `%`