Make and return a single node
192351
def make_node(name, value=nil, attributes={})
      node = Ox::Element.new(name)

      node << value unless value.nil?
      attributes.each { |att, val| node[att] = val } unless attributes.empty?
      
      node
    end
887720
def build_module(name, doc=None):
    """"""
    node = nodes.Module(name, doc, pure_python=False)
    node.package = False
    node.parent = None
    return node
504420
def _create_node(self, name, factory, directory=None, create=1):
        
        import SCons.Util
        node = factory(name, directory, create)
        node.set_noclean(self.noclean)
        node.set_precious(self.precious)
        if self.nodefault:
            self.env.Ignore('.', node)
        if self.alias:
            self.env.AlwaysBuild(self.env.Alias(self.alias, node))
        return node
623297
def partition_node(node):
    """"""
    host = node
    port = 27017
    idx = node.rfind(':')
    if idx != -1:
        host, port = node[:idx], int(node[idx + 1:])
    if host.startswith('['):
        host = host[1:-1]
    return host, port
894936
def make_node(cls, func_name, lineno, type_=None):
        
        entry = global_.SYMBOL_TABLE.declare_func(func_name, lineno, type_=type_)
        if entry is None:
            return None

        entry.declared = True
        return cls(entry, lineno)
838219
def get_node(self, node_id):
        """"""
        try:
            node_object = self.nodes[node_id]
        except KeyError:
            raise NonexistentNodeError(node_id)
        return node_object
1296847
def single(self):
        
        nodes = super(ZeroOrOne, self).all()
        if len(nodes) == 1:
            return nodes[0]
        if len(nodes) > 1:
            raise CardinalityViolation(self, len(nodes))
1121501
def get_node(self,obj,cls=type(None),hist={}):
        
        #~ ident = getattr(obj,'ident',obj)
        if obj in self.modules and is_module(obj,cls):
            return self.modules[obj]
        elif obj in self.submodules and is_submodule(obj,cls):
            return self.submodules[obj]
        elif obj in self.types and is_type(obj,cls):
            return self.types[obj]
        elif obj in self.procedures and is_proc(obj,cls):
            return self.procedures[obj]
        elif obj in self.programs and is_program(obj,cls):
            return self.programs[obj]
        elif obj in self.sourcefiles and is_sourcefile(obj,cls):
            return self.sourcefiles[obj]
        elif obj in self.blockdata and is_blockdata(obj,cls):
            return self.blockdata[obj]
        else:
            self.register(obj,cls,hist)
            return self.get_node(obj,cls,hist)
21152
def _construct_node(loader, node, base_tag):
    ""
    node = copy.copy(node) # bypass YAML anti recursion
    best_tag = base_tag
    best_fit = 0
    for key, val in loader.DEFAULT_TAGS.iteritems():
        lenk = len(key)
        if lenk <= best_fit:
            continue
        if base_tag.startswith(key):
            best_tag = val + base_tag[lenk:]
            best_fit = lenk
    node.tag = best_tag
    return loader.construct_object(node, deep=True)
114574
def make_node(lower, upper, lineno):
        
        if not is_static(lower, upper):
            syntax_error(lineno, 'Array bounds must be constants')
            return None

        if isinstance(lower, SymbolVAR):
            lower = lower.value
        if isinstance(upper, SymbolVAR):
            upper = upper.value

        lower.value = int(lower.value)
        upper.value = int(upper.value)

        if lower.value < 0:
            syntax_error(lineno, 'Array bounds must be greater than 0')
            return None

        if lower.value > upper.value:
            syntax_error(lineno, 'Lower array bound must be less or equal to upper one')
            return None

        return SymbolBOUND(lower.value, upper.value)
1135271
def _get(self, node, key):
        
        node_type = self._get_node_type(node)

        if node_type == NODE_TYPE_BLANK:
            return BLANK_NODE

        if node_type == NODE_TYPE_BRANCH:
            # already reach the expected node
            if not key:
                return node[-1]
            sub_node = self._decode_to_node(node[key[0]])
            return self._get(sub_node, key[1:])

        # key value node
        curr_key = without_terminator(unpack_to_nibbles(node[0]))
        if node_type == NODE_TYPE_LEAF:
            return node[1] if key == curr_key else BLANK_NODE

        if node_type == NODE_TYPE_EXTENSION:
            # traverse child nodes
            if starts_with(key, curr_key):
                sub_node = self._decode_to_node(node[1])
                return self._get(sub_node, key[len(curr_key):])
            else:
                return BLANK_NODE
1339376
def make_node(cls, *args):
        
        new_args = []

        args = [x for x in args if not is_null(x)]
        for x in args:
            assert isinstance(x, Symbol)
            if x.token == 'BLOCK':
                new_args.extend(SymbolBLOCK.make_node(*x.children).children)
            else:
                new_args.append(x)

        result = SymbolBLOCK(*new_args)
        return result
984501
def convert_to_node(instance, xml_node: XmlNode, node_globals: InheritedDict = None)\
    -> InstanceNode:
    ''''''
    return InstanceNode(instance, xml_node, node_globals)
1322187
def element(cls, name, parent=None, interleave=None, occur=0):
        """"""
        node = cls("element", parent, interleave=interleave)
        node.attr["name"] = name
        node.occur = occur
        return node
317665
def create_node(self, name, project_id, node_id, *args, **kwargs):
        

        if node_id in self._nodes:
            return self._nodes[node_id]

        project = ProjectManager.instance().get_project(project_id)
        if node_id and isinstance(node_id, int):
            # old project
            with (yield from BaseManager._convert_lock):
                node_id = yield from self.convert_old_project(project, node_id, name)

        if not node_id:
            node_id = str(uuid4())

        node = self._NODE_CLASS(name, node_id, project, self, *args, **kwargs)
        if asyncio.iscoroutinefunction(node.create):
            yield from node.create()
        else:
            node.create()
        self._nodes[node.id] = node
        project.add_node(node)
        return node
1282447
function makeShimNode(main) {
	return {
		bundles: [main],
		dependencies: ["@loader"],
		deps: ["@loader"],
		load: {
			address: "",
			metadata: {
				format: "amd",
				deps: ["@loader"],
				dependencies: ["@loader"]
			},
			name: "@steal",
			source: `
				define("@steal", ["@loader"], function(atLoader) {
					var steal = {};

					steal.loader = atLoader;
					steal.done = function() {
						return Promise.resolve();
					};

					return steal;
				});
			`
		}
	};
}
1351934
def visit_return(self, node):
        """"""
        if node.is_tuple_return() and len(node.value.elts) > 1:
            elts = [child.accept(self) for child in node.value.elts]
            return "return %s" % ", ".join(elts)

        if node.value:
            return "return %s" % node.value.accept(self)

        return "return"