## nodeLists.register Registers a nodeList and returns the nodeList passed to register
496837
function (nodeList, unregistered, parent, directlyNested) {
			// If a unregistered callback has been provided assign it to the nodeList
			// as a property to be called when the nodeList is unregistred.
			CID(nodeList);
			nodeList.unregistered = unregistered;
			nodeList.parentList = parent;
			nodeList.nesting = parent && typeof parent.nesting !== 'undefined' ? parent.nesting + 1 : 0;

			if(parent) {
				nodeList.deepChildren = [];
				nodeList.newDeepChildren = [];
				nodeList.replacements = [];
				if(parent !== true) {
					if(directlyNested) {
						parent.replacements.push(nodeList);
					}
					else {
						parent.newDeepChildren.push(nodeList);
					}
				}
			}
			else {
				nodeLists.nestList(nodeList);
			}


			return nodeList;
		}
270153
function register(server, options, next) {
	Schema.validate(options, function (error, config) {
		if (error) {
			next(error);
		} else {
			let methodsAsync = {};
			const dirs = config.methods;
			_.each(dirs, (dir) => {
				const relativePath = path.relative(__dirname, process.cwd() + '/' + dir);
				importDirectory(module, relativePath, {
					visit: function (obj) {
						if (!_.isUndefined(obj)) {
							let methods = _.isArray(obj) ? obj : [obj]; 
							_.each(methods, (method) => {
								if (_.isObject(method) && _.isFunction(method.method)) {
									const instance = _.clone(method);
									// store the oringial method
									const asyncMethod = method.method;
									// convert async function to normal thunky function
									instance.method = function (...args) {
										// the handler after function is called
										const after = args[args.length - 1];
										// call the async method, since asyn function return promise, use then and catch to handle result and error by handler
										asyncMethod.apply(this, args).then((result) => after(null, result)).catch((err) => after(err));
									};
									server.method(instance);
								}
							});
						}
					}
				});
			});
			_.each(server.methods, (method, name) => {
				methodsAsync[name] = function (...args) {
					// async function is a function return promise
					// convert back the async function
					return new Promise((resolve, reject) => {
						// call the thunky function
						server.methods[name].apply(server.methods, args.concat([(err, result) => {
							// reject if error exists, resolve if error not exists
							if (err) {
								reject(err);
							} else {
								resolve(result);
							}
						}]));
					});
				};
				// drop cache should also support async
				if (method.cache) {
					methodsAsync[name].cache = Promise.promisifyAll(method.cache);
				}
			});
			server.decorate('server', config.name, methodsAsync);
			next();
		}
	});
}
20837
function registerElementPatch(_global) {
    if (!isBrowser || !('registerElement' in _global.document)) {
        return;
    }
    var _registerElement = document.registerElement;
    var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
    document.registerElement = function (name, opts) {
        if (opts && opts.prototype) {
            callbacks.forEach(function (callback) {
                var source = 'Document.registerElement::' + callback;
                if (opts.prototype.hasOwnProperty(callback)) {
                    var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);
                    if (descriptor && descriptor.value) {
                        descriptor.value = Zone.current.wrap(descriptor.value, source);
                        _redefineProperty(opts.prototype, callback, descriptor);
                    }
                    else {
                        opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);
                    }
                }
                else if (opts.prototype[callback]) {
                    opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);
                }
            });
        }
        return _registerElement.apply(document, [name, opts]);
    };
}
910456
function(newNodeLists, parentNodeList, render, context, args) {
		var itemNodeList = [];

		if (parentNodeList) {
			// With a supplied parent list, "directly" register the new nodeList
			//  as a child.
			nodeLists.register(itemNodeList, null, true, true);
			itemNodeList.parentList = parentNodeList;
			itemNodeList.expression = "#each SUBEXPRESSION";
		}

		// call the renderer, passing in the new nodeList as the last argument
		var itemHTML = render.apply(context, args.concat([itemNodeList])),
			// and put the output into a document fragment
			itemFrag = frag(itemHTML);

		// get all the direct children of the frag
		var children = canReflect.toArray(childNodes(itemFrag));
		if (parentNodeList) {
			// if a parent list was supplied, children of the frag become the
			//  child nodeList items.
			nodeLists.update(itemNodeList, children);
			newNodeLists.push(itemNodeList);
		} else {
			// If no parent nodeList, register the new array of frag children as a nodeList
			//  and push into the nodeLists
			newNodeLists.push(nodeLists.register(children));
		}
		return itemFrag;
	}
350791
function registerHandlebarsHelpers() {
  Handlebars.registerHelper('foreach', function(arr, options) {
    if (options.inverse && !arr.length) {
      return options.inverse(this);
    }
    return arr
      .map(function(item, index) {
        item.$index = index;
        item.$first = index === 0;
        item.$last = index === arr.length - 1;
        item.$notFirst = index !== 0;
        item.$notLast = index !== arr.length - 1;
        return options.fn(item);
      })
      .join('');
  });
}
1099697
@SuppressWarnings("unchecked")
  private <T> Node registerClass(final Class<T> c)
      throws ClassHierarchyException {
    if (c.isArray()) {
      throw new UnsupportedOperationException("Can't register array types");
    }
    try {
      return getAlreadyBoundNode(c);
    } catch (final NameResolutionException ignored) {
      // node not bound yet
    }

    final Node n = buildPathToNode(c);

    if (n instanceof ClassNode) {
      final ClassNode<T> cn = (ClassNode<T>) n;
      final Class<T> superclass = (Class<T>) c.getSuperclass();
      if (superclass != null) {
        try {
          ((ClassNode<T>) getAlreadyBoundNode(superclass)).putImpl(cn);
        } catch (final NameResolutionException e) {
          throw new IllegalStateException(e);
        }
      }
      for (final Class<?> interf : c.getInterfaces()) {
        try {
          ((ClassNode<T>) getAlreadyBoundNode(interf)).putImpl(cn);
        } catch (final NameResolutionException e) {
          throw new IllegalStateException(e);
        }
      }
    }
    return n;
  }
47052
function(nodeList, parent) {
        // Ensure that {let} nodes are always at the beginning of a containter element
        var node, contentFound = false; // true when a node different from let is found
        for (var i = 0; i < nodeList.length; i++) {
            node = nodeList[i];
            //console.log(i+":"+node.type)
            if (node.type === "comment") {
                continue;
            }
            if (node.type==="text") {
                // tolerate static white space text
                if (node.value.match(/^\s*$/)) {
                    continue;
                }
            }
            if (node.type === "let") {
                if (contentFound) {
                    // error: let must be defined before any piece of content
                    this._logError("Let statements must be defined at the beginning of a block", node);
                } else {
                    parent.needSubScope = true;
                }
            } else {
                contentFound = true;
                if (node.content) {
                    this._processNodeContent(node.content, node);
                }
                if (node.content1) {
                    this._processNodeContent(node.content1, node);
                }
                if (node.content2) {
                    this._processNodeContent(node.content2, node);
                }
            }
        }
    }
810575
public void addNodes(NodeList nodelist)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

    if (null != nodelist)  // defensive to fix a bug that Sanjiva reported.
    {
      int nChildren = nodelist.getLength();

      for (int i = 0; i < nChildren; i++)
      {
        Node obj = nodelist.item(i);

        if (null != obj)
        {
          addElement(obj);
        }
      }
    }

    // checkDups();
  }
467789
def register(app_name, modules):
    
    global INSTALLED_APPS_REGISTER
    mod_list = INSTALLED_APPS_REGISTER.get(app_name, [])

    if isinstance(modules, basestring):
        mod_list.append(modules)
    elif is_iterable(modules):
        mod_list.extend(modules)

    INSTALLED_APPS_REGISTER[app_name] = mod_list
750168
function registerComponents (newComponents) {
  var config = Vue$2.config;
  var newConfig = {};
  if (Array.isArray(newComponents)) {
    newComponents.forEach(function (component) {
      if (!component) {
        return
      }
      if (typeof component === 'string') {
        components[component] = true;
        newConfig[component] = true;
      } else if (typeof component === 'object' && typeof component.type === 'string') {
        components[component.type] = component;
        newConfig[component.type] = true;
      }
    });
    var oldIsReservedTag = config.isReservedTag;
    config.isReservedTag = function (name) {
      return newConfig[name] || oldIsReservedTag(name)
    };
  }
}
46909
def _convert_nodelist(self, impl_nodelist):
        
        nodelist = [
            self.adapter.wrap_node(n, self.adapter.impl_document, self.adapter)
            for n in impl_nodelist]
        return NodeList(nodelist)
360182
function registerEventListener(eventList, callback) {
       for (var x = 0; x < eventList.length; x++) {
         if (POINTER_MOVE.indexOf(eventList[x]) === -1) {
           me.video.renderer.getScreenCanvas().addEventListener(eventList[x], callback, false);
         }
       }
     }
297985
function(selector) {
        var nodelist = Y.all(Y.Selector.query(selector, this._node));
        nodelist._query = selector;
        nodelist._queryRoot = this._node;
        return nodelist;
    }
1198472
function TagList(props: Props): React.Node {
  const { children, className } = props;
  const classes = cn("tags", className);
  return <div className={classes}>{children}</div>;
}
143317
public static List<Element> nodeListToList(NodeList<Element> nodelist) {

        List<Element> result = Lists.newArrayList();
        for (int i = 0; i < nodelist.getLength(); i++) {
            result.add(nodelist.getItem(i));
        }
        return result;
    }
1372444
function register(handle) {
  if (Array.isArray(handle)) {
    handle.forEach(item => {
      utils.register(item);
    });
  } else {
    utils.register(handle);
  }
}
199453
def register_element_cls(tag, cls):
    
    nspfx, tagroot = tag.split(':')
    namespace = element_class_lookup.get_namespace(nsmap[nspfx])
    namespace[tagroot] = cls