select json for this path
968187
function select( state, json, path, isSeekAll ) {

        var steps = getSteps( state, path );
        if ( !steps.length ) { return { json: null }; }

        var paths = getCachedPaths( state, json );
        var walker = !!paths ? cachedWalk : walk;
        var found = walker( paths || json,
                            isSeekAll ? [] : null,
                            selectStep( steps, isSeekAll ) );

        var lastStep = steps[ 0 ].path;
        return {

            json: found,
            isFinal: ( isSeekAll ? found.length === 0 : found === null ) ||
                !!~[ "@id", "@index", "@value", "@type" ].indexOf( lastStep )

        };

    }
388229
def getpath(d, json_path, default=None, sep='.'):
    '''
    '''
    for key in json_path.split(sep):
        try:
            d = d[key]
        except (KeyError, TypeError):
            return default
    return d
470896
def jsondel(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.DEL', name, str_path(path))
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)
648533
def load_json(self, path):
        """"""
        with open(self.profile_path(path, must_exist=True),
                  encoding='utf-8') as f:
            data = json.load(f)
        return data
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
607317
def _get(path, args = {})
      path.sub! /\A\//, ''
      args['wt'] = 'json'
      res        = JSON.parse(raw_get_content(path, args))
      if res['error']
        raise RuntimeError.new, res['error']
      end
      res
    end
35026
def for_json(self):
        """"""
        cursor = super(CursorField, self).for_json()
        if cursor is not None:
            # Lambda called immediately, false-positive from pylint on closure scope warning
            # pylint: disable=cell-var-from-loop
            return [getattr(item, 'for_json', lambda: item)() for item in cursor]
798256
def post_json(path, data = {})
      @request_uri = "#{@base_uri}#{path}" 
      body = JSON.generate(data)
      extheader = { 'Content-Type' => 'application/json' }
      req  = post_request(path, body, extheader)
      @res = http_connection.start {|http| http.request(req) }
      handle_error(@res, @request_uri)
      JSON.parse(@res.body)
    end
587523
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            json_string = f.read()
        return cls.from_json(json_string)
173830
def json_path_components(path):
    
    if isinstance(path, str):
        path = path.split('.')

    return list(path)
732788
def file_path(self, request, response=None, info=None):
        
        return json.dumps(self._extract_key_info(request))
484616
def load_from_json(file_path):
    """"""
    if os.path.exists(file_path):
        raw_data = open(file_path, 'rb').read()
        return json.loads(base64.decodestring(raw_data).decode('utf-8'))
321781
def to_json(self, path: Optional[str] = None, **kwargs) -> str:
        
        from .io import save_json
        return save_json(self, path, **kwargs)
590226
private JsonObject load(Path path) throws IOException {
    try (InputStream stream = Resources.getResource(path.toString()).openStream()) {
      return (JsonObject) JSON_PARSER.parse(new InputStreamReader(stream));
    }
  }
1031166
def get_json_val(source, path, *, ignore_bad_path=False):
  """"""
  try:
    return JP.find(source, path)
  except JP.JSONPathError as ex:
    if ignore_bad_path:
      return None
    else:
      raise
939245
private JSONObject getJSONFromPath(String path) throws LRException
    {
        JSONObject json = null;
        String jsonTxt = null;
        
        try
        {
            jsonTxt = LRClient.executeJsonGet(importProtocol + "://" + nodeHost + path);
        }
        catch(Exception e)
        {
            throw new LRException(LRException.IMPORT_FAILED);
            //e.printStackTrace();
        }
        
        try
        {
            json = new JSONObject(jsonTxt);
        }
        catch(JSONException e)
        {
            throw new LRException(LRException.JSON_IMPORT_FAILED);
            //e.printStackTrace();
        }

        return json;
    }