def update_to(
        self,
        chunk_number: int = 1,
        max_chunk_size: int = 1,
        total_size: int | None = None,
    ) -> None:
        """Update progress bar based on download progress.

        This method is used as a callback for ``urlretrieve`` to update the
        progress bar during downloads.

        Args:
            chunk_number: Current chunk being processed
            max_chunk_size: Maximum size of each chunk
            total_size: Total download size
        """
        if total_size is not None:
            self.total = total_size
        self.update(chunk_number * max_chunk_size - self.n)
Update progress bar based on download progress.

        This method is used as a callback for ``urlretrieve`` to update the
        progress bar during downloads.

        Args:
            chunk_number: Current chunk being processed
            max_chunk_size: Maximum size of each chunk
            total_size: Total download size
        
src/anomalib/data/utils/download.py