Return JSON for tree starting at `node`.
6366
def export(self, node):
        """"""
        dictexporter = self.dictexporter or DictExporter()
        data = dictexporter.export(node)
        return json.dumps(data, **self.kwargs)
137727
@Post("/node/node")
    public JsonNode json1(@RequestObject JsonNode input) {
        final JsonNode name = input.get("name");
        return mapper.valueToTree(new Response(Response.SUCCESS, name.textValue()));
    }
653670
def json(self):
        """"""
        return {
            "id": self.ID,
            "steps": self.steps,
            "graph_source": self.source,
            "errored": self.errored
        }
104571
def default_tree_traversal(root, leaves):
    
    objs = [('#', root)]
    while len(objs) > 0:
        path, obj = objs.pop()

        # name of child are json-pointer encoded, we don't have
        # to encode it again.
        if obj.__class__ not in leaves:
            objs.extend(map(lambda i: (path + '/' + i[0],) + (i[1],), six.iteritems(obj._children_)))

        # the path we expose here follows JsonPointer described here
        #   http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
        yield path, obj
446118
def read_tree_from_json(srcpath):
    
    with open(srcpath) as infile:
        json_tree = json.load(infile)
        if json_tree is None:
            raise ValueError('Could not find ricecooker json tree')
    return json_tree
119644
def prepare(data):
    """"""
    sha = data.get("sha")
    tree = data.get("tree")
    return {"sha": sha, "tree": tree}
1101782
def to_json(self):
        """"""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }
500323
def to_json(self):
        """"""
        return {
            'network': self.network,
            'state': self.state,
            'nodes': self.node_indices,
            'cut': self.cut,
        }
33632
def tree(self, sha):
        
        json = None
        if sha:
            url = self._build_url('git', 'trees', sha, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Tree(json, self) if json else None
746386
def from_json(graph_json_dict: Mapping[str, Any], check_version=True) -> BELGraph:
    """"""
    graph = node_link_graph(graph_json_dict)
    return ensure_version(graph, check_version=check_version)
441322
private static JsonNode toJson(AggregatedHttpMessage res, @Nullable JsonNodeType expectedNodeType) {
        final String content = toString(res);
        final JsonNode node;
        try {
            node = Jackson.readTree(content);
        } catch (JsonParseException e) {
            throw new CentralDogmaException("failed to parse the response JSON", e);
        }

        if (expectedNodeType != null && node.getNodeType() != expectedNodeType) {
            throw new CentralDogmaException(
                    "invalid server response; expected: " + expectedNodeType +
                    ", actual: " + node.getNodeType() + ", content: " + content);
        }
        return node;
    }
1070149
def get_channel_node_from_json(json_tree):
    
    channel = ChannelNode(
        title=json_tree['title'],
        description=json_tree['description'],
        source_domain=json_tree['source_domain'],
        source_id=json_tree['source_id'],
        language=json_tree['language'],
        thumbnail=json_tree.get('thumbnail', None),
    )
    return channel
265565
def getroot(self):
        """"""
        builder = ET.TreeBuilder()
        self.build(builder)
        return builder.close()
814081
async def json(self, *, loads: JSONDecoder=DEFAULT_JSON_DECODER) -> Any:
        """"""
        body = await self.text()
        return loads(body)
16937
def _get(self):
        """"""

        data, stat = self.zk.get(self.path)
        if not len(data):
            return {}, stat.version
        if self.OLD_SEPARATOR in data:
            return self._get_old()
        return json.loads(data), stat.version
1057480
def visit_return(self, node, parent):
        """"""
        newnode = nodes.Return(node.lineno, node.col_offset, parent)
        if node.value is not None:
            newnode.postinit(self.visit(node.value, newnode))
        return newnode
1130764
def to_json(self):
        """"""
        sets = self.sets()
        return sorted(sorted(x) for x in sets)