def fetch(self, download_if_missing=True): """ Verify data only. Data must be downloaded from kaggle. """ for fname, sha1 in FILES_SHA1s: local_filename = self.home(fname) verify_sha1(local_filename, sha1)
def install(self, local_fer2013): """ Verify SHA1 and copy given file into .skdata cache directory. """ verify_sha1(local_fer2013, TGZ_SHA1) if not os.path.isdir(self.home()): os.makedirs(self.home()) lock = lockfile.FileLock(self.home()) if lock.is_locked(): logger.warn('%s is locked, waiting for release' % self.home()) with lock: shutil.copyfile(local_fer2013, self.home(TGZ_FILENAME)) extract(self.home(TGZ_FILENAME), self.home())