Navigate to specified path
767559
function navigate(path, replace){
    if (replace)
      location.replace(location.pathname + '#' + path);
    else
      location.hash = path;

    if (started)
      checkUrl();
  }
922519
def print_path(path: Path) -> str:
    """"""
    path_str = ""
    current_path: Optional[Path] = path
    while current_path:
        path_str = (
            f".{current_path.key}"
            if isinstance(current_path.key, str)
            else f"[{current_path.key}]"
        ) + path_str
        current_path = current_path.prev
    return f"value{path_str}" if path_str else ""
649493
def _path_to_value(cls, path, parent_dict):
        """"""
        keys = cls._path_to_keys(path)

        # Traverse to the tip of the path
        child_dict = parent_dict
        for key in keys[:-1]:
            child_dict = child_dict.get(key)
            if child_dict is None:
                return

        return child_dict.get(keys[-1])
490039
def _fixpath(self, p):
        """"""
        return os.path.abspath(os.path.expanduser(p))
535872
def setup_path():
    """"""
    import os.path; import sys

    if sys.argv[0]:
        top_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
        sys.path = [os.path.join(top_dir, "src")] + sys.path
        pass
    return
726043
def _walk_to_root(path, break_at=None):
    
    if not os.path.exists(path):  # pragma: no cover
        raise IOError("Starting path not found")

    if os.path.isfile(path):  # pragma: no cover
        path = os.path.dirname(path)

    last_dir = None
    current_dir = os.path.abspath(path)
    paths = []
    while last_dir != current_dir:
        paths.append(current_dir)
        paths.append(os.path.join(current_dir, "config"))
        if break_at and current_dir == os.path.abspath(break_at):  # noqa
            logger.debug("Reached the %s directory, breaking.", break_at)
            break
        parent_dir = os.path.abspath(os.path.join(current_dir, os.path.pardir))
        last_dir, current_dir = current_dir, parent_dir
    return paths
678285
function findPage(pages, path) {
  const p = path.shift();
  const page = pages.find(page => page.path === p);

  if (!page) {
    return {redirect: getDefaultPath(pages)};
  }
  if (page.children) {
    const result = findPage(page.children, path);
    if (result.page) {
      return result;
    }
    return {redirect: [p].concat(result.redirect)};
  }
  if (path.length) {
    return {redirect: []};
  }
  return {page};
}
683165
function seekArray(data, pathArr, result, key) {
    var subpath = pathArr[1];
    var path = pathArr[0];
    var seek = jsonPath.eval(data, path) || [];

    if (seek.length && subpath) {
      result = result[key] = [];

      seek[0].forEach(function(item, index) {
        walk(item, subpath, result, index);
      });
    } else {
      result[key] = seek;
    }
  }
1352600
private ResourcePathNode<D> navigateFrom(ResourcePathNode<D> resourcePath) {

    if (isParentDirectory()) {
      ResourcePathNode<D> result = resourcePath;
      ResourcePathNode<D> segment = this;
      do {
        assert (segment.isParentDirectory());
        if (result.isParentDirectory()) {
          return new ResourcePathNode<>(result, segment.name, segment.data);
        } else {
          result = result.navigateUp();
        }
        segment = segment.parent;
      } while (segment.parent != null);
      return result;
    } else if (this.parent == null) {
      return resourcePath;
    } else {
      return new ResourcePathNode<>(this.parent.navigateFrom(resourcePath), this.name, this.data);
    }
  }
367101
function seekSingle(data, pathStr, result, key) {
    if(pathStr.indexOf('$') < 0){
      result[key] = pathStr;
    }else{
      var seek = jsonPath.eval(data, pathStr) || [];

      result[key] = seek.length ? seek[0] : undefined;
    }
  }
317779
def _checkpath(self, path):
        
        if path.startswith("/") or ".." in path or path.strip() != path:
            raise NotFoundException()
300080
def choose_path():
    
    dirs = webview.create_file_dialog(webview.FOLDER_DIALOG)
    if dirs and len(dirs) > 0:
        directory = dirs[0]
        if isinstance(directory, bytes):
            directory = directory.decode("utf-8")

        response = {"status": "ok", "directory": directory}
    else:
        response = {"status": "cancel"}

    return jsonify(response)
314488
function(req, res, router) {
    if (router.static) {
      findPath(req, res, router, function() {
        if (!routeFinder(router, req, res)) {
          routeNoFound(req, res);
        }
      });
    } else {
      if (!routeFinder(router, req, res)) {
        routeNoFound(req, res);
      }
    }
  }
161403
function walk(data, path, result, key) {
    var fn;

    switch (type(path)) {
      case 'string':
        fn = seekSingle;
        break;

      case 'array':
        fn = seekArray;
        break;

      case 'object':
        fn = seekObject;
        break;
    }

    if (fn) {
      fn(data, path, result, key);
    }
  }
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
1158803
function(path) {
    var bind = path;
    if (process.platform === 'win32') {
      bind = path.replace(/\\/g, '/').replace('C:/', 'c:/');
    }
    return bind;
  }
1236379
def fast_relpath(path, start):
  """"""
  relpath = fast_relpath_optional(path, start)
  if relpath is None:
    raise ValueError('{} is not a directory containing {}'.format(start, path))
  return relpath