Initialize an instance of `NodeResults` from a `Node` subclass.
487095
def from_node(cls, node):
        """"""
        kwargs = dict(
            node_id=node.node_id,
            node_finalized=node.finalized,
            node_history=list(node.history),
            node_name=node.name,
            node_class=node.__class__.__name__,
            node_status=str(node.status),
        )

        return node.Results(node, **kwargs)
817932
def visit_dictcomp(self, node, parent):
        """"""
        newnode = nodes.DictComp(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.key, newnode),
            self.visit(node.value, newnode),
            [self.visit(child, newnode) for child in node.generators],
        )
        return newnode
182421
function create_node(error, result) {
    if(error) {
      callback(error);
    } else {
      parentNodeData = result;
      Node.create({
        guid: context.guid,
        type: type
      }, function(error, result) {
        if(error) {
          callback(error);
          return;
        }
        node = result;
        node.nlinks += 1;
        context.putObject(node.id, node, update_parent_node_data);
      });
    }
  }
538969
def create_node(xml_node: XmlNode, **init_args):
    ''''''
    inst_type = get_inst_type(xml_node)
    init_args['xml_node'] = xml_node
    inst = create_inst(inst_type, **init_args)
    if not isinstance(inst, Node):
        inst = convert_to_node(inst, **init_args)
    return inst
149855
function (node) {
                if (node.init && (node.init.type === "FunctionExpression" || node.init.type === "ArrowFunctionExpression")) {
                    _addResult(node);
                }
            }
806891
protected function initialize(): void
    {
        if ($this->result === null) {
            $queryBuilder = $this->elasticSearchQuery->getQueryBuilder();
            $this->result = $queryBuilder->fetch();
            $this->nodes = $this->result['nodes'];
            $this->count = $queryBuilder->getTotalItems();
        }
    }
1128594
def _init_nodes(self, config):
        
        if not isinstance(config, dict):
            raise TypeError('"config" must be a dictionary')

        for (name, conf) in six.iteritems(config):
            args = [] if 'args' not in conf else conf['args']
            kwargs = {} if 'kwargs' not in conf else conf['kwargs']

            dependencies = set()
            arg_deps = self._get_dependencies_from_args(args)
            kwarg_deps = self._get_dependencies_from_kwargs(kwargs)

            dependencies.update(arg_deps)
            dependencies.update(kwarg_deps)

            self._nodes[name] = dependencies
278701
public static final void registerNodeDataInstance(
			Class<? extends NodeData> clazz) {
		try {
			@SuppressWarnings("unused")
			NodeData test = clazz.newInstance();
			ndImpl = clazz;
		} catch (InstantiationException e) {
			throw new RuntimeException("NodeData implemenation ("
					+ clazz.getName() + ") doesn't provide sole constructor", e);
		} catch (IllegalAccessException e) {
			throw new RuntimeException("NodeData implementation ("
					+ clazz.getName() + ") is not accesible", e);
		}

	}
1315107
def from_payload(self, payload):
        """"""
        self.status = NodeInformationStatus(payload[0])
        self.node_id = payload[1]
362092
@SuppressWarnings("unchecked")
    public static <T extends Node> void findNodes(List<Node> nodes, Class<T> cls, List<T> results) {
        for (Node n : nodes) {
            if (n instanceof ContainerNode) {
                findNodes(((ContainerNode) n).getNodes(), cls, results);
            }

            if (cls == n.getClass()) {
                results.add((T) n);
            }
        }
    }
301351
def visit_annassign(self, node, parent):
        """"""
        newnode = nodes.AnnAssign(node.lineno, node.col_offset, parent)
        annotation = _visit_or_none(node, "annotation", self, newnode)
        newnode.postinit(
            target=self.visit(node.target, newnode),
            annotation=annotation,
            simple=node.simple,
            value=_visit_or_none(node, "value", self, newnode),
        )
        return newnode
432817
def visit_expr(self, node, parent):
        """"""
        newnode = nodes.Expr(node.lineno, node.col_offset, parent)
        newnode.postinit(self.visit(node.value, newnode))
        return newnode
343043
def nodes_in(self, name) -> iter:
        """"""
        yield from (node for node in self.all_in(name) if self.is_node(node))
263528
def _visit_for(self, cls, node, parent):
        """"""
        newnode = cls(node.lineno, node.col_offset, parent)
        type_annotation = self.check_type_comment(node)
        newnode.postinit(
            target=self.visit(node.target, newnode),
            iter=self.visit(node.iter, newnode),
            body=[self.visit(child, newnode) for child in node.body],
            orelse=[self.visit(child, newnode) for child in node.orelse],
            type_annotation=type_annotation,
        )
        return newnode
664456
def ensure_node(self, tokens: ParseResults) -> BaseEntity:
        """"""
        if MODIFIER in tokens:
            return self.ensure_node(tokens[TARGET])

        node = parse_result_to_dsl(tokens)
        self.graph.add_node_from_data(node)
        return node
1310672
def add_node(self, node):
        """"""
        self.nodes.append(node)

        # add node_ids
        try:
            if node.node_id != b"$stats":
                self.node_ids.append(node.node_id)
        except NotImplementedError:
            raise
        except Exception:
            print("ERROR: getting Node")
155993
protected void initJspConfig(XmlParser.Node node)
    {
        for (int i=0;i<node.size();i++)
        {
            Object o=node.get(i);
            if (o instanceof XmlParser.Node && "taglib".equals(((XmlParser.Node)o).getTag()))
                initTagLib((XmlParser.Node)o);
        }
    }