Returns the path to a temporary object, before we know its hash.
197308
def cache_path(self, name):
        
        return os.path.join(self._path, self.CACHE_DIR, name)
849552
def relpath_for(self, path):
        """"""
        if self.parent_dir in (".", ""):
            return path

        if path == self.parent_dir:
            return ""

        dirname = os.path.dirname(path) or "."
        basename = os.path.basename(path)

        cached = self.relpath_cache.get(dirname, empty)
        if cached is empty:
            cached = self.relpath_cache[dirname] = os.path.relpath(dirname, self.parent_dir)

        return os.path.join(cached, basename)
862587
def temporary_url(expires_at = Time.now + 3600)
      signature = Signature.generate_temporary_url_signature(:bucket => name,
                                                             :resource => key,
                                                             :expires_at => expires_at,
                                                             :secret_access_key => secret_access_key)

      "#{url}?AWSAccessKeyId=#{self.bucket.service.access_key_id}&Expires=#{expires_at.to_i.to_s}&Signature=#{signature}"
    end
789941
def to_hash
      result = {
        name: @name,
        value: @value,
        domain: @domain,
        path: @path,
        created_at: @created_at
      }
      {
        expiry: @expiry,
        secure: (true if @secure),
        http_only: (true if @http_only),
        version: (@version if version != 0),
        comment: @comment,
        comment_url: @comment_url,
        discard: (true if @discard),
        ports: @ports
      }.each do |name, value|
        result[name] = value if value
      end

      result
    end
883479
def _path_hash(path, transform, kwargs):
    
    sortedargs = ["%s:%r:%s" % (key, value, type(value))
                  for key, value in sorted(iteritems(kwargs))]
    srcinfo = "{path}:{transform}:{{{kwargs}}}".format(path=os.path.abspath(path),
                                                   transform=transform,
                                                   kwargs=",".join(sortedargs))
    return digest_string(srcinfo)
1332859
def __get_file_path(self, path, saltenv='base'):
        '''
        
        '''
        try:
            path = self._check_proto(path)
        except MinionError as err:
            # Local file path
            if not os.path.isfile(path):
                log.warning(
                    'specified file %s is not present to generate hash: %s',
                    path, err
                )
                return None
            else:
                return path
        return self._find_file(path, saltenv)
908230
def path(self):
        """"""
        out = self.datetime.strftime("%Y-%m-%d")
        out += " "
        ssm = (
            self.datetime - self.datetime.replace(hour=0, minute=0, second=0, microsecond=0)
        ).total_seconds()
        out += str(int(ssm)).zfill(5)
        return out
512965
def get_hash(self, handle):
        """"""
        fpath = self._fpath_from_handle(handle)
        return DiskStorageBroker.hasher(fpath)
427939
private URI getNextTemporaryPath() {
    Path basePath = ghfs.getHadoopPath(finalGcsPath);
    Path baseDir = basePath.getParent();
    Path tempPath = new Path(
        baseDir,
        String.format("%s%s.%d.%s",
            TEMPFILE_PREFIX, basePath.getName(), curComponentIndex, UUID.randomUUID().toString()));
    return ghfs.getGcsPath(tempPath);
  }
72033
def get_temporary_link(path)
      resp = request('/files/get_temporary_link', path: path)
      return FileMetadata.new(resp['metadata']), resp['link']
    end
692137
def _path_to_keys(cls, path):
        """"""

        # Paths are cached for performance
        keys = _BaseFrame._path_to_keys_cache.get(path)
        if keys is None:
            keys = _BaseFrame._path_to_keys_cache[path] = path.split('.')

        return keys
1218126
def _get_path(self, filename):
        """"""
        tempdir = settings._temp_directory
        if not os.path.exists(tempdir):
            os.makedirs(tempdir)
        return os.path.join(tempdir, filename)
693705
def build_path_to(script_name = nil, *args)
    args.compact!
    query = args.pop if args.last.kind_of?(Hash)
    path  = map_path_to(script_name, *args)
    path << "?" << Rack::Utils::build_query(query) if query
    path
  end
1104705
def _TempRootPath():
  """"""
  # `FLAGS.test_tmpdir` is defined only in test environment, so we can't expect
  # for it to be always defined.
  test_tmpdir = (
      compatibility.Environ("TEST_TMPDIR", default=None) or
      FLAGS.get_flag_value("test_tmpdir", default=None))

  if not os.path.exists(test_tmpdir):
    # TODO: We add a try-catch block to avoid rare race condition.
    # In Python 3 the exception being thrown is way more specific
    # (`FileExistsError`) but in Python 2 `OSError` is the best we can do. Once
    # support for Python 2 is dropped we can switch to catching that and remove
    # the conditional (EAFP).
    try:
      os.makedirs(test_tmpdir)
    except OSError as err:
      logging.error(err)

  # TODO(hanuszczak): Investigate whether this check still makes sense.
  if platform.system() == "Windows":
    return None

  return test_tmpdir
1020288
def _make_tmp_path(self, remote_user=None):
        
        LOG.debug('_make_tmp_path(remote_user=%r)', remote_user)
        path = self._generate_tmp_path()
        LOG.debug('Temporary directory: %r', path)
        self._connection.get_chain().call_no_reply(os.mkdir, path)
        self._connection._shell.tmpdir = path
        return path
1237464
def getobjpath(obj, path):
    
    if not path:
        return obj
    if path.startswith("["):
        item = path[1:path.index("]")]
        return getobjpath(obj[item], path[len(item) + 2:])
    if path.startswith("."):
        path = path[1:]
    if "." in path or "[" in path:
        dot_idx = path.find(".")
        bracket_idx = path.find("[")
        if dot_idx == -1 or bracket_idx < dot_idx:
            idx = bracket_idx
            next_idx = idx
        else:
            idx = dot_idx
            next_idx = idx + 1
        attr = path[:idx]
        return getobjpath(getattr(obj, attr), path[next_idx:])
    return getattr(obj, path)
964980
def get_path(self):
        
        path = deque()
        __, node = self.get_focus()
        while not node.is_root():
            stats = node.get_value()
            path.appendleft(hash(stats))
            node = node.get_parent()
        return path