Return path to ricecooker json tree file. Override this method to use
        a custom filename, e.g., for channel with multiple languages.
325000
def get_json_tree_path(self, *args, **kwargs):
        
        json_tree_path = os.path.join(self.TREES_DATA_DIR, self.RICECOOKER_JSON_TREE)
        return json_tree_path
83134
def get_json_or_yaml(file_path, content):
    
    if os.path.splitext(file_path)[1] == ".json":
        return json.dumps(content, sort_keys=False, indent=4, separators=(',', ': '))
    else:
        return inginious.common.custom_yaml.dump(content)
383674
def export_json(self, filename):
        
        json_graph = self.to_json()
        with open(filename, 'wb') as f:
            f.write(json_graph.encode('utf-8'))
1273076
def to_dict(self, info_filename, tree_filename, dash_f_e=False):
        
        logger.debug('info_filename: {} {}'
                     .format(info_filename, '(FOUND)' if os.path.exists(info_filename) else '(NOT FOUND)'))
        logger.debug('tree_filename: {} {}'
                     .format(tree_filename, '(FOUND)' if os.path.exists(tree_filename) else '(NOT FOUND)'))
        if dash_f_e:
            return self._dash_f_e_to_dict(info_filename, tree_filename)
        else:
            return self._to_dict(info_filename, tree_filename)
1076360
def jsonarrappend(self, name, path=Path.rootPath(), *args):
        
        pieces = [name, str_path(path)]
        for o in args:
            pieces.append(self._encode(o))
        return self.execute_command('JSON.ARRAPPEND', *pieces)
608779
def get_filepath(self, filename):
        
        return os.path.join(self.parent_folder, '{},{},{}'.format(self.tile_name, self.date, self.aws_index),
                            self.add_file_extension(filename)).replace(':', '.')
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);
    }
288832
def get_json_path(self, path):
        
        return self.with_json_path(path, field='result').values_list('result', flat=True)
1179819
function treeJSON(name, location, timestamp, dir, length, addNameToLoc) {
        location = api.toURLPath(location);
        if (typeof addNameToLoc == 'undefined' || addNameToLoc) {
            location += "/" + name;
        }
        var result = {
            Name: name,
            LocalTimeStamp: timestamp,
            Directory: dir,
            Length: length,
            Location: location ? contextPath +"/sharedWorkspace/tree/file" + location : contextPath +"/sharedWorkspace/tree",
            ChildrenLocation: dir ? (location ? contextPath +"/sharedWorkspace/tree/file" + location + "?depth=1": contextPath +"/sharedWorkspace/tree" + "?depth=1") : undefined,
            Parents: fileUtil.getParents(contextPath +'/sharedWorkspace/tree/file' + location.split('/').splice(0, 2).join('/'), location.split('/').splice(2).join('/')),
            Attributes: {
                ReadOnly: false
            }
        };
        result.ImportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/import").replace(/\/$/, "");
        result.ExportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/export").replace(/\/$/, "") + ".zip";
        return result;
    }
989918
def loads_json_or_yaml(file_path, content):
    
    if os.path.splitext(file_path)[1] == ".json":
        return json.loads(content)
    else:
        return inginious.common.custom_yaml.load(content)
1073813
def get_dict_from_json_file(path, encoding='utf-8'):
    
    with open(path, encoding=encoding) as data_file:
        return json.loads(data_file.read())
822083
def get_json(file_name='../dxf.json.template'):
    
    with open(file_name, 'r') as f:
        t = json.load(f)
    return t
245161
def read_json(file_path):
    
    try:
        with open(file_path, 'r') as f:
            config = json_tricks.load(f)
    except ValueError:
        print('    '+'!'*58)
        print('    Woops! Looks the JSON syntax is not valid in:')
        print('        {}'.format(file_path))
        print('    Note: commonly this is a result of having a trailing comma \n    in the file')
        print('    '+'!'*58)
        raise

    return config
233829
def load_json(filename: str) -> Union[List, Dict]:
    
    try:
        with open(filename, encoding='utf-8') as fdesc:
            return json.loads(fdesc.read())
    except FileNotFoundError:
        # This is not a fatal error
        _LOGGER.debug('JSON file not found: %s', filename)
    except ValueError as error:
        _LOGGER.exception('Could not parse JSON content: %s', filename)
        raise PytradfriError(error)
    except OSError as error:
        _LOGGER.exception('JSON file reading failed: %s', filename)
        raise PytradfriError(error)
    return {}
1011161
def get_node(name, merged=False):
    """"""
    if merged:
        node_path = os.path.join("data_bags", "node", name.replace('.', '_') + ".json")
    else:
        node_path = os.path.join("nodes", name + ".json")
    if os.path.exists(node_path):
        # Read node.json
        with open(node_path, 'r') as f:
            try:
                node = json.loads(f.read())
            except ValueError as e:
                msg = 'LittleChef found the following error in'
                msg += ' "{0}":\n                {1}'.format(node_path, str(e))
                abort(msg)
    else:
        print "Creating new node file '{0}.json'".format(name)
        node = {'run_list': []}
    # Add node name so that we can tell to which node it is
    node['name'] = name
    if not node.get('chef_environment'):
        node['chef_environment'] = '_default'
    return node
1147822
function getTypingNamesFromJson(jsonPath, filesToWatch) {
                if (host.fileExists(jsonPath)) {
                    filesToWatch.push(jsonPath);
                }
                var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
                if (result.config) {
                    var jsonConfig = result.config;
                    if (jsonConfig.dependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
                    }
                    if (jsonConfig.devDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
                    }
                    if (jsonConfig.optionalDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
                    }
                    if (jsonConfig.peerDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
                    }
                }
            }
76422
def cook_path
      relative_path = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'cook_runner')
      return File.normalize_path(relative_path)
    end