def scan_files(self, hashes, ultra):

        files = self.find_files()
        num_files = len(files)

        self.total_files = num_files

        cache_time, meta_data_cache = self.read_metadata_cache()

        checked_queue = Queue()

        self.start_scan_workers(files, checked_queue, hashes, ultra, cache_time, meta_data_cache)

        files_scanned = []
        files_to_upload = []
        meta_data = {}
        update_meta_data = False
        newer_time = -1

        while True:
            item = checked_queue.get()

            if item is None or self.stopped: # Stop event
                break

            elif isinstance(item, basestring): # Invalid file
                num_files -= 1

            else:
                if len(item) == 4: # Nothing to do for this file
                    relative_path, file_size, file_hash, file_time = item
                    meta_data[relative_path] = meta_data_cache[relative_path]
                    files_scanned.append((relative_path, file_size, file_hash))

                else:
                    if len(item) == 5: # Only need to update meta data cache
                        relative_path, file_size, file_hash, file_md5, file_time = item
                        files_scanned.append((relative_path, file_size, file_hash))

                    else: # Need to upload too
                        deploy_path, relative_path, file_size, file_hash, file_md5, file_time = item
                        files_to_upload.append((deploy_path, relative_path, file_size, file_hash, file_md5))

                    meta_data[relative_path] = {'length': file_size,
                                                'hash': file_hash,
                                                'md5': file_md5}
                    update_meta_data = True

                if file_time < newer_time:
                    newer_time = file_time

                self.num_bytes += file_size
                self.num_files += 1

            if self.num_files >= num_files:
                break

            item = None

        if self.stopped:
            # Copy old data to avoid recalculations
            meta_data.update(meta_data_cache)

        if update_meta_data or newer_time > cache_time or len(meta_data) != len(meta_data_cache):
            self.write_metadata_cache(meta_data, newer_time)
            self.delete_unused_cache_files(meta_data, meta_data_cache)

        return files_scanned, files_to_upload
    # pylint: enable=R0914
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/lib/deploy.py/Deployment.scan_files/swapped operands of `<`