jsonpath : jsonpath '[' sorts ']
962643
def p_jsonpath_sort(self, p):
        "'"
        sort = _iterable.SortedThis(p[3])
        p[0] = jsonpath_rw.Child(p[1], sort)
1188514
def _sorter(generated):
    """"""
    pairs = [(os.path.dirname(f), os.path.basename(f))
             for f in set(list(generated))]

    pairs.sort()

    return [os.path.join(pair[0], pair[1]) for pair in pairs]
1265468
public Object getJsonPath(String json, String jsonPath) {
        if (!JsonPath.isPathDefinite(jsonPath)) {
            throw new RuntimeException(jsonPath + " returns a list of results, not a single.");
        }
        return parseJson(json).read(jsonPath);
    }
566983
public JSONResource json(JSONPathQuery path) throws Exception {
		Object jsonValue = path.eval(this);
		return json(jsonValue.toString());
	}
81727
function filterRunnables(JSONs, paths, taskName) {
  // since the JSONS array might shrink, pass huxleyfile paths too and shrink
  // accordingly
  if (taskName == null) {
    return [JSONs, paths];
  }

  var filtered = JSONs.map(function(JSONContent) {
    return JSONContent.filter(function(task) {
      return task.name === taskName;
    });
  });

  var newJSONs = [];
  var newPaths = [];
  for (var i = 0; i < filtered.length; i++) {
    if (filtered[i].length !== 0) {
      newJSONs.push(filtered[i]);
      newPaths.push(paths[i]);
    }
  }

  return [newJSONs, newPaths];
}
1059348
function SortOrderComparator(sortOrder, options) {
        this.sortOrder = sortOrder;
        this.options = {
            casesensitive: false
        };
        if (options) {
            _.extend(this.options, options);
        }
        this.expressions = new Array(sortOrder.sortFields.length);
        for (var i = 0; i < this.expressions.length; ++i) {
            this.expressions[i] = new JsonPath_1.JsonPath(sortOrder.sortFields[i].name);
        }
    }
288832
def get_json_path(self, path):
        
        return self.with_json_path(path, field='result').values_list('result', flat=True)
481701
function sortPaths(items/* , [iteratee, ] dirSeparator */) {
    assert(arguments.length >= 2, 'too few arguments');
    assert(arguments.length <= 3, 'too many arguments');

    var iteratee, dirSeparator;

    if (arguments.length === 2) {
        iteratee = identity;
        dirSeparator = arguments[1];
    }
    else {
        iteratee = arguments[1];
        dirSeparator = arguments[2];
    }

    assert(isArray(items), 'items is not an array');
    assert(isFunction(iteratee), 'iteratee is not a function');
    assert(typeof dirSeparator === 'string', 'dirSeparator is not a String');
    assert(dirSeparator.length === 1, 'dirSeparator must be a single character');

    //encapsulate into DTOs
    var itemDTOs = items.map(function (item) {
        var path = iteratee(item);

        assert(typeof path === 'string', 'item or iteratee(item) must be a String');

        return {
            item: item,
            pathTokens: splitRetain(path, dirSeparator)
        };
    });

    //sort DTOs
    itemDTOs.sort(createItemDTOComparator(dirSeparator));

    //decapsulate sorted DTOs and return
    return itemDTOs.map(function (itemDTO) {
        return itemDTO.item;
    });
}
158923
def jsonobjlen(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.OBJLEN', name, str_path(path))
1237724
def jsonobjkeys(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.OBJKEYS', name, str_path(path))
218272
public static <T> ConfigurableJsonMatcher<T> jsonPartEquals(String path, Object expected) {
        return new JsonPartMatcher<>(path, expected);
    }
10302
public static <T> T loadJsonToBean(String jsonPath, Class<T> clazz) throws IOException {
        return loadJsonToBean(jsonPath, ValueConsts.NULL_STRING, clazz);
    }
218316
function jsonCompare(arg, options) {
    var sortOrder;
    if (typeof arg === 'string') {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON([arg]);
    }
    else if (_.isArray(arg)) {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON(arg);
    }
    else {
        sortOrder = arg;
    }
    var comparator = new SortOrderComparator(sortOrder, options);
    return (_.bind(comparator.compare, comparator));
}
3144
function fromJson(collection, collectionPath, next) {

  var docsBulk = [];
  var docs = fs.readdirSync(collectionPath);
  var last = ~~docs.length, counter = 0;
  if (last === 0) {
    return next(null);
  }

  docs.forEach(function(docName) {

    var doc, data;
    try {
      data = fs.readFileSync(collectionPath + docName);
    } catch (err) {
      return last === ++counter ? next(null) : null;
    }
    try {
      doc = JSON.parse(data);
    } catch (err) {
      return last === ++counter ? next(err) : error(err);
    }

    docsBulk.push({
      insertOne: {
        document: doc
      }
    });

    return last === ++counter ? collection.bulkWrite(docsBulk, next) : null;
  });
}
1053716
def load_json_path(path):
    """"""
    with open(path) as handle:
        try: return json.load(handle, object_pairs_hook=collections.OrderedDict)
        except ValueError as error:
            message = "Could not decode JSON file '%s'." % path
            message = "-"*20 + "\n" + message + "\n" + str(error) + "\n" + "-"*20 + "\n"
            sys.stderr.write(message)
            raise error
502324
@Override
    @Path("/{dataType}")
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        String dataType = getSegment(path, 1);
        if (dataType == null)
            throw new ServiceException("Missing path segment: {dataType}");
        try {
            BaselineData baselineData = DataAccess.getBaselineData();
            if (dataType.equals("VariableTypes")) {
                List<VariableType> variableTypes = baselineData.getVariableTypes();
                JSONArray jsonArray = new JSONArray();
                for (VariableType variableType : variableTypes)
                    jsonArray.put(variableType.getJson());
                return new JsonArray(jsonArray).getJson();
            }
            else if (dataType.equals("TaskCategories")) {
                List<TaskCategory> taskCats = new ArrayList<TaskCategory>();
                taskCats.addAll(baselineData.getTaskCategories().values());
                Collections.sort(taskCats);
                JSONArray jsonArray = new JSONArray();
                for (TaskCategory taskCat : taskCats)
                    jsonArray.put(taskCat.getJson());
                return new JsonArray(jsonArray).getJson();
            }
            else {
                throw new ServiceException("Unsupported dataType: " + dataType);
            }
        }
        catch (Exception ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
628602
def jsonarrindex(self, name, path, scalar, start=0, stop=-1):
        
        return self.execute_command('JSON.ARRINDEX', name, str_path(path), self._encode(scalar), start, stop)