def to_storage(
        self,
        output: Union[str, os.PathLike[str]],
        signal: str = "file",
        placement: FileExportPlacement = "fullpath",
        link_type: Literal["copy", "symlink"] = "copy",
        num_threads: Optional[int] = EXPORT_FILES_MAX_THREADS,
        anon: bool = False,
        client_config: Optional[dict] = None,
    ) -> None:
        """Export files from a specified signal to a directory. Files can be
        exported to a local or cloud directory.

        Args:
            output: Path to the target directory for exporting files.
            signal: Name of the signal to export files from.
            placement: The method to use for naming exported files.
                The possible values are: "filename", "etag", "fullpath", and "checksum".
            link_type: Method to use for exporting files.
                Falls back to `'copy'` if symlinking fails.
            num_threads : number of threads to use for exporting files.
                By default it uses 5 threads.
            anon: If true, we will treat cloud bucket as public one
            client_config: Optional configuration for the destination storage client

        Example:
            Cross cloud transfer
            ```py
            import datachain as dc

            ds = dc.read_storage("s3://mybucket")
            ds.to_storage("gs://mybucket", placement="filename")
            ```
        """
        if placement == "filename" and (
            self._query.distinct(pathfunc.name(C(f"{signal}__path"))).count()
            != self._query.count()
        ):
            raise ValueError("Files with the same name found")

        if anon:
            client_config = (client_config or {}) | {"anon": True}

        progress_bar = tqdm(
            desc=f"Exporting files to {output}: ",
            unit=" files",
            unit_scale=True,
            unit_divisor=10,
            total=self.count(),
            leave=False,
        )
        file_exporter = FileExporter(
            output,
            placement,
            self._settings.cache if self._settings else False,
            link_type,
            max_threads=num_threads or 1,
            client_config=client_config,
        )
        file_exporter.run(self.collect(signal), progress_bar)
Export files from a specified signal to a directory. Files can be
        exported to a local or cloud directory.

        Args:
            output: Path to the target directory for exporting files.
            signal: Name of the signal to export files from.
            placement: The method to use for naming exported files.
                The possible values are: "filename", "etag", "fullpath", and "checksum".
            link_type: Method to use for exporting files.
                Falls back to `'copy'` if symlinking fails.
            num_threads : number of threads to use for exporting files.
                By default it uses 5 threads.
            anon: If true, we will treat cloud bucket as public one
            client_config: Optional configuration for the destination storage client

        Example:
            Cross cloud transfer
            ```py
            import datachain as dc

            ds = dc.read_storage("s3://mybucket")
            ds.to_storage("gs://mybucket", placement="filename")
            ```
        
src/datachain/lib/dc/datachain.py