Sets path to dataset. Warning: function with side effects!

    :param path: path you want to store dataset
    :param cache: CacheFile object
    :param cachefile: default '~/.io3d_cache.yaml'
543936
def set_dataset_path(path, cache=None, cachefile="~/.io3d_cache.yaml"):
    
    if cachefile is not None:
        cache = cachef.CacheFile(cachefile)
    cache.update("local_dataset_dir", path)
70005
def load_path(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        if os.path.isfile(path):
            if path in self.list_files():
                self.set_current_editor(path)
            else:
                self.load_file(path)
        else:
            if not path in self.list_projects():
                self.add_project(path)
        return True
41072
private void initFileDirTables(Path path) throws IOException {
    FileStatus[] stats = fs.listStatus(path);
    if (stats != null) {
      for (FileStatus stat : stats) {
        if (stat.isDir()) {
          dirs.add(stat.getPath().toString());
          initFileDirTables(stat.getPath());
        } else {
          Path filePath = stat.getPath();
          if (filePath.getName().startsWith(StructureGenerator.FILE_NAME_PREFIX)) {
            files.add(filePath.toString());
          }
        }
      }
    }
  }
898844
public void registerCachedFile(String filePath, String name) throws IOException {
		if (!this.cacheFile.containsKey(name)) {
			try {
				URI u = new URI(filePath);
				if (!u.getPath().startsWith("/")) {
					u = new URI(new File(filePath).getAbsolutePath());
				}
				FileSystem fs = FileSystem.get(u);
				if (fs.exists(new Path(u.getPath()))) {
					this.cacheFile.put(name, u.toString());
				} else {
					throw new RuntimeException("File " + u.toString() + " doesn't exist.");
				}
			} catch (URISyntaxException ex) {
				throw new RuntimeException("Invalid path: " + filePath, ex);
			}
		} else {
			throw new RuntimeException("cache file " + name + "already exists!");
		}
	}
904246
def put_path(self, url, path):
        
        cache_path = self._url_to_path(url)

        # Ensure that cache directories exist
        try:
            dir = os.path.dirname(cache_path)
            os.makedirs(dir)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise Error('Failed to create cache directories for ' % cache_path)

        # Remove the resource already exist
        try:
            os.unlink(cache_path)
        except OSError:
            pass

        try:
            # First try hard link to avoid wasting disk space & overhead
            os.link(path, cache_path)
        except OSError:
            try:
                # Use file copy as fallaback
                shutil.copyfile(path, cache_path)
            except IOError:
                raise Error('Failed to cache %s as %s for %s' % (path, cache_path, url))
1346240
def open_dataset(path, **kwargs):
    # type: (str, T.Any) -> xr.Dataset
    
    if 'engine' in kwargs and kwargs['engine'] != 'cfgrib':
        raise ValueError("only engine=='cfgrib' is supported")
    kwargs['engine'] = 'cfgrib'
    return xr.backends.api.open_dataset(path, **kwargs)
1055936
def add_directory(self, path, ignore=None):
        
        for root, dirs, files in os.walk(path):
            arc_prefix = os.path.relpath(root, os.path.dirname(path))
            # py3 remove pyc cache dirs.
            if '__pycache__' in dirs:
                dirs.remove('__pycache__')
            for f in files:
                dest_path = os.path.join(arc_prefix, f)

                # ignore specific files
                if ignore and ignore(dest_path):
                    continue

                if f.endswith('.pyc') or f.endswith('.c'):
                    continue
                f_path = os.path.join(root, f)

                self.add_file(f_path, dest_path)
70751
def set_path(ctx, path_str, value, data):
    
    ctx.gbc.say('set_path:value:' + str(value) + ' at:' + path_str + ' in:',
                stuff=data, verbosity=1001)

    path = path_str.split('.')
    ctx.gbc.say('path:', stuff=path, verbosity=100)
    if len(path) > 1:
        destk = '.'.join(path[0:-1])
        lp = path[-1]
        ctx.gbc.say('destk:%s' % destk, verbosity=100)
        ctx.gbc.say('last:%s' % lp, verbosity=100)
        ctx.gbc.say('current keys:', stuff=data.keys(), verbosity=1001)
        if len(path) > 2:
            destk = unescape(ctx, destk)
        if destk not in data.keys():
            ctx.gbc.say('destk not in current keys:',
                        stuff=data.keys(), verbosity=1001)
            data[destk] = {}
            ctx.gbc.say('destk not added:', stuff=data, verbosity=1001)

        lp = unescape(ctx, lp)
        data[destk][lp] = value
        ctx.gbc.say('destk and val added:', stuff=data, verbosity=1001)
    else:
        path_str = unescape(ctx, path_str)
        data[path_str] = value
    ctx.gbc.say('set_path:res:', stuff=data, verbosity=1001)
    return data
654747
def CacheFileObject(self, path_spec, file_object):
    
    self._file_object_cache.CacheObject(path_spec.comparable, file_object)
53634
def cache_file(self, local_path, ip, path):
        
        destination = self.__destination(ip, path)
        atomicish_move(local_path, destination)
197308
def cache_path(self, name):
        
        return os.path.join(self._path, self.CACHE_DIR, name)
291815
def path_in_cache(self, filename, metahash):
        
        cpath = self._genpath(filename, metahash)
        if os.path.exists(cpath):
            return cpath
        else:
            raise CacheMiss
1372865
def set_data_dir(path=None, store=None):
    
    import sys
    import os
    import pysat
    if sys.version_info[0] >= 3:
        if sys.version_info[1] < 4:
            import imp
            re_load = imp.reload
        else:
            import importlib
            re_load = importlib.reload
    else:
        re_load = reload
    if store is None:
        store = True    
    if os.path.isdir(path):
        if store:
            with open(os.path.join(os.path.expanduser('~'), '.pysat',
                                   'data_path.txt'), 'w') as f:
                f.write(path)
        pysat.data_dir = path
        pysat._files = re_load(pysat._files)
        pysat._instrument = re_load(pysat._instrument)
    else:
        raise ValueError('Path %s does not lead to a valid directory.' % path)
1251560
def setFilepath( self, filepath ):
        
        self._filepath = nativestring(filepath)
        self.setIcon(QIcon(filepath))
        if ( not self.signalsBlocked() ):
            self.filepathChanged.emit(filepath)
532408
def load_data(path:PathOrStr, file:PathLikeOrBinaryStream='data_save.pkl', bs:int=64, val_bs:int=None, num_workers:int=defaults.cpus,
              dl_tfms:Optional[Collection[Callable]]=None, device:torch.device=None, collate_fn:Callable=data_collate,
              no_check:bool=False, **kwargs)->DataBunch:
    ""
    source = Path(path)/file if is_pathlike(file) else file
    ll = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source)
    return ll.databunch(path=path, bs=bs, val_bs=val_bs, num_workers=num_workers, dl_tfms=dl_tfms, device=device,
                        collate_fn=collate_fn, no_check=no_check, **kwargs)
504157
public void setCACertificatePath(Path caCertificatePath)
  {
    try {
      _caCertificatePath = caCertificatePath.toRealPath().toString();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
1217360
def set(self, path, data):
        
        return self._zk.set(self.__path(path), data)