:param path: an .hdf5 pathname
        :param extra: extra attributes to be saved in the file
767594
def save(self, path, **extra):
        
        with File(path, 'w') as f:
            for key, val in vars(self).items():
                assert val is not None, key  # sanity check
                try:
                    f[key] = maybe_encode(val)
                except ValueError as err:
                    if 'Object header message is too large' in str(err):
                        logging.error(str(err))
            for k, v in extra.items():
                f.attrs[k] = maybe_encode(v)
1074455
def to_hdf5(self, filepath: str):
        
        try:
            self.start("Saving data to Hdf5...")
            dd.io.save(filepath, self.df)
            self.end("Finished saving Hdf5 data")
        except Exception as e:
            self.err(e, "Can not convert data to Hdf5")
227414
def expand_path(path, params = {})
      path = path.dup
      path = "/#{path}" unless path =~ /^\// # make sure path starts with /
      path = "/#{option(:api_version)}#{path}" unless path =~ /^\/v[\d.]+\// # preprend api version
      params.each do |key, value|
        path << (path['?'] ? '&' : '?')
        path << expand_param(key, value)
      end
      path
    end
341670
def save(self, path):
        
        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        if not name:
            raise ValueError, "name is required"

        path = os.path.join(folder, name + self.extension)
        f = open(path, "wb")
        f.write(self.contents)
        f.close()

        return path
1112191
def extract_path_ext(path, default_ext=None):
    
    ext = None
    _, dotext = os.path.splitext(path)
    if dotext:
        ext = dotext[1:]
    if not ext and default_ext:
        ext = default_ext
    if not ext:
        raise ValueError('No extension in path {} and default_ext is None'.format(path))
    return ext
1004957
def _append_path(new_path):  # type: (str) -> None
    
    for path in sys.path:
        path = os.path.abspath(path)
        if new_path == path:
            return
    sys.path.append(new_path)
1121682
def __format_path(self, path):
        
        # Unicode strings are converted back to strings, because it seems
        # that inotify_add_watch from ctypes does not work well when
        # it receives an ctypes.create_unicode_buffer instance as argument.
        # Therefore even wd are indexed with bytes string and not with
        # unicode paths.
        if isinstance(path, unicode):
            path = path.encode(sys.getfilesystemencoding())
        return os.path.normpath(path)
884680
def clean_extra(self):
        """"""
        extra_paths = self.get_extra_paths()
        for path in extra_paths:
            if not os.path.exists(path):
                continue
            if os.path.isdir(path):
                self._clean_directory(path)
            else:
                self._clean_file(path)
832273
def save(self, path):
        
        with open(path, 'w') as out_file:
            json.dump(self.to_dict(), out_file, indent=4)
767213
def fs_encode(path):
    

    path = _get_path(path)
    if path is None:
        raise TypeError("expected a valid path to encode")
    if isinstance(path, six.text_type):
        if six.PY2:
            return b"".join(
                (
                    _byte(ord(c) - 0xDC00)
                    if 0xDC00 <= ord(c) <= 0xDCFF
                    else c.encode(_fs_encoding, _fs_encode_errors)
                )
                for c in path
            )
        return path.encode(_fs_encoding, _fs_encode_errors)
    return path
1352440
def exists(self, path):
        
        import hdfs
        try:
            self.client.status(path)
            return True
        except hdfs.util.HdfsError as e:
            if str(e).startswith('File does not exist: '):
                return False
            else:
                raise e
1258228
def HashFilePath(self, path, byte_count):
    
    with open(path, "rb") as fd:
      self.HashFile(fd, byte_count)
286972
def prepend_path(path)
      self.config = hash_reassoc(config, :paths) do |paths|
        path = File.expand_path(path, config[:root]).freeze
        paths.unshift(path)
      end
    end
572799
def extend_path(pth, name):
  '''
  
  '''

  def zip_isfile(z, name):
    name.rstrip('/')
    return name in z.namelist()

  pname = os.path.join(*name.split('.'))
  zname = '/'.join(name.split('.'))
  init_py = '__init__' + os.extsep + 'py'
  init_pyc = '__init__' + os.extsep + 'pyc'
  init_pyo = '__init__' + os.extsep + 'pyo'

  mod_path = list(pth)
  for path in sys.path:
    if zipfile.is_zipfile(path):
      try:
        egg = zipfile.ZipFile(path, 'r')
        addpath = (
          zip_isfile(egg, zname + '/__init__.py') or
          zip_isfile(egg, zname + '/__init__.pyc') or
          zip_isfile(egg, zname + '/__init__.pyo'))
        fpath = os.path.join(path, path, zname)
        if addpath and fpath not in mod_path:
          mod_path.append(fpath)
      except (zipfile.BadZipfile, zipfile.LargeZipFile):
        pass  # xxx: Show a warning at least?
    else:
      path = os.path.join(path, pname)
      if os.path.isdir(path) and path not in mod_path:
        addpath = (
          os.path.isfile(os.path.join(path, init_py)) or
          os.path.isfile(os.path.join(path, init_pyc)) or
          os.path.isfile(os.path.join(path, init_pyo)))
        if addpath and path not in mod_path:
          mod_path.append(path)

  return [os.path.normpath(x) for x in mod_path]
57447
def get_file_path(self, path):
        
        feature_filename = self._get_filename_path(path)

        feature_filename += self.file_format.extension()
        if self.compress_level:
            feature_filename += FileFormat.GZIP.extension()

        return feature_filename
521538
def real_path(aPath)
			(path = Pathname.new(::File.expand_path(aPath))) && path.realpath.to_s
		end
766601
def pfx_path(path):
    
    if path[0] != os.path.sep: return os.path.sep + path
    else:                      return path