MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / maybeDownloadAndExtract

Function maybeDownloadAndExtract

sentiment/data.js:196–204  ·  view source on GitHub ↗

* Get the IMDB data through file downloading and extraction. * * If the files already exist on the local file system, the download and/or * extraction steps will be skipped.

()

Source from the content-addressed store, hash-verified

194 * extraction steps will be skipped.
195 */
196async function maybeDownloadAndExtract() {
197 const zipDownloadDest = path.join(os.tmpdir(), path.basename(DATA_ZIP_URL));
198 await maybeDownload(DATA_ZIP_URL, zipDownloadDest);
199
200 const zipExtractDir =
201 zipDownloadDest.slice(0, zipDownloadDest.length - ZIP_SUFFIX.length);
202 await maybeExtract(zipDownloadDest, zipExtractDir);
203 return zipExtractDir;
204}
205
206/**
207 * Load data by downloading and extracting files if necessary.

Callers 1

loadDataFunction · 0.85

Calls 2

maybeExtractFunction · 0.85
maybeDownloadFunction · 0.70

Tested by

no test coverage detected