MCPcopy Index your code
hub / github.com/tensorflow/datasets / publish_data

Function publish_data

tensorflow_datasets/core/utils/file_utils.py:571–587  ·  view source on GitHub ↗

Publishes the data from the given `from_data_dir` to `to_data_dir`. Arguments: from_data_dir: the folder whose data needs to be published. to_data_dir: folder where the data should be published. Should include config and version. overwrite: whether to overwrite existing data in

(
    from_data_dir: epath.Path,
    to_data_dir: epath.Path,
    overwrite: bool = False,
)

Source from the content-addressed store, hash-verified

569
570
571def publish_data(
572 from_data_dir: epath.Path,
573 to_data_dir: epath.Path,
574 overwrite: bool = False,
575) -> None:
576 """Publishes the data from the given `from_data_dir` to `to_data_dir`.
577
578 Arguments:
579 from_data_dir: the folder whose data needs to be published.
580 to_data_dir: folder where the data should be published. Should include
581 config and version.
582 overwrite: whether to overwrite existing data in the `publish_root_dir` if
583 it exists.
584 """ # fmt: skip
585 to_data_dir.mkdir(parents=True, exist_ok=True)
586 for filepath in from_data_dir.iterdir():
587 filepath.copy(dst=to_data_dir / filepath.name, overwrite=overwrite)
588
589
590def bulk_rename(

Callers

nothing calls this directly

Calls 2

iterdirMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected