This function should be triggered upon ``doctree-resolved event``

    Replace all item_list nodes with a list of the collected items.
    Augment each item with a backlink to the original location.
508878
def process_item_nodes(app, doctree, fromdocname):
    
    env = app.builder.env

    all_items = sorted(env.traceability_all_items, key=naturalsortkey)

    # Item matrix:
    # Create table with related items, printing their target references.
    # Only source and target items matching respective regexp shall be included
    for node in doctree.traverse(item_matrix):
        table = nodes.table()
        tgroup = nodes.tgroup()
        left_colspec = nodes.colspec(colwidth=5)
        right_colspec = nodes.colspec(colwidth=5)
        tgroup += [left_colspec, right_colspec]
        tgroup += nodes.thead('', nodes.row(
            '',
            nodes.entry('', nodes.paragraph('', 'Source')),
            nodes.entry('', nodes.paragraph('', 'Target'))))
        tbody = nodes.tbody()
        tgroup += tbody
        table += tgroup

        for source_item in all_items:
            if re.match(node['source'], source_item):
                row = nodes.row()
                left = nodes.entry()
                left += make_item_ref(app, env, fromdocname,
                                      env.traceability_all_items[source_item])
                right = nodes.entry()
                for target_item in all_items:
                    if (re.match(node['target'], target_item) and
                            are_related(
                                env, source_item, target_item, node['type'])):
                        right += make_item_ref(
                            app, env, fromdocname,
                            env.traceability_all_items[target_item])
                row += left
                row += right
                tbody += row

        node.replace_self(table)

    # Item list:
    # Create list with target references. Only items matching list regexp
    # shall be included
    for node in doctree.traverse(item_list):
        content = nodes.bullet_list()
        for item in all_items:
            if re.match(node['filter'], item):
                bullet_list_item = nodes.list_item()
                paragraph = nodes.paragraph()
                paragraph.append(
                    make_item_ref(app, env, fromdocname,
                                  env.traceability_all_items[item]))
                bullet_list_item.append(paragraph)
                content.append(bullet_list_item)

        node.replace_self(content)

    # Resolve item cross references (from ``item`` role)
    for node in doctree.traverse(pending_item_xref):
        # Create a dummy reference to be used if target reference fails
        new_node = make_refnode(app.builder,
                                fromdocname,
                                fromdocname,
                                'ITEM_NOT_FOUND',
                                node[0].deepcopy(),
                                node['reftarget'] + '??')
        # If target exists, try to create the reference
        if node['reftarget'] in env.traceability_all_items:
            item_info = env.traceability_all_items[node['reftarget']]
            try:
                new_node = make_refnode(app.builder,
                                        fromdocname,
                                        item_info['docname'],
                                        item_info['target']['refid'],
                                        node[0].deepcopy(),
                                        node['reftarget'])
            except NoUri:
                # ignore if no URI can be determined, e.g. for LaTeX output :(
                pass

        else:
            env.warn_node(
                'Traceability: item %s not found' % node['reftarget'], node)

        node.replace_self(new_node)
532717
function (list, e, item) {
			this.options.todos.push(item);
			// Reset the filter so that you always see your new todo
			this.options.state.attr('filter', '');
		}
236136
public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
        synchronized (mLock) {
            final int position = getPosition(oldObject);
            if (position == -1) {
                // not found, don't replace
                return;
            }

            mObjects.remove(position);
            mObjects.add(position, newObject);

            if (isItemTheSame(oldObject, newObject)) {
                if (isContentTheSame(oldObject, newObject)) {
                    // visible content hasn't changed, don't notify
                    return;
                }

                // item with same stable id has changed
                notifyItemChanged(position, newObject);
            } else {
                // item replaced with another one with a different id
                notifyItemRemoved(position);
                notifyItemInserted(position);
            }
        }
    }
945080
function changedActiveItems(dataSource) {
  reviseLegendHelper(dataSource);
  updateEntitiesAndExtent(dataSource); // Only does anything if there are lat & lon columns.
  dataSource._changed.raiseEvent(dataSource);
}
793620
def extend(self, items):
        
        print('\n'.join(items))
        super(MyList, self).extend(items)
1123457
def update_items(self, ocean_backend, enrich_backend):
        """"""

        fltr = {
            'name': 'origin',
            'value': [self.perceval_backend.origin]
        }

        logger.debug("[update-items] Checking commits for %s.", self.perceval_backend.origin)

        git_repo = GitRepository(self.perceval_backend.uri, self.perceval_backend.gitpath)

        try:
            current_hashes = set([commit for commit in git_repo.rev_list()])
        except Exception as e:
            logger.error("Skip updating branch info for repo %s, git rev-list command failed: %s", git_repo.uri, e)
            return

        raw_hashes = set([item['data']['commit']
                          for item in ocean_backend.fetch(ignore_incremental=True, _filter=fltr)])

        hashes_to_delete = list(raw_hashes.difference(current_hashes))

        to_process = []
        for _hash in hashes_to_delete:
            to_process.append(_hash)

            if len(to_process) != MAX_BULK_UPDATE_SIZE:
                continue

            # delete documents from the raw index
            self.remove_commits(to_process, ocean_backend.elastic.index_url,
                                'data.commit', self.perceval_backend.origin)
            # delete documents from the enriched index
            self.remove_commits(to_process, enrich_backend.elastic.index_url,
                                'hash', self.perceval_backend.origin)

            to_process = []

        if to_process:
            # delete documents from the raw index
            self.remove_commits(to_process, ocean_backend.elastic.index_url,
                                'data.commit', self.perceval_backend.origin)
            # delete documents from the enriched index
            self.remove_commits(to_process, enrich_backend.elastic.index_url,
                                'hash', self.perceval_backend.origin)

        logger.debug("[update-items] %s commits deleted from %s with origin %s.",
                     len(hashes_to_delete), ocean_backend.elastic.anonymize_url(ocean_backend.elastic.index_url),
                     self.perceval_backend.origin)
        logger.debug("[update-items] %s commits deleted from %s with origin %s.",
                     len(hashes_to_delete), enrich_backend.elastic.anonymize_url(enrich_backend.elastic.index_url),
                     self.perceval_backend.origin)

        # update branch info
        self.delete_commit_branches(enrich_backend)
        self.add_commit_branches(git_repo, enrich_backend)
58478
def add_items(self, data_dict, root=None, target=None):
        
        if root is None:
            print("Warning: TreeCtrl root must be given.")
            return
        if target is None:
            print("Warning: TreeCtrl target must be given.")
            return
        for k in sorted(data_dict):
            if isinstance(data_dict[k], dict):
                k_item_root = target.AppendItem(root, k)
                self.add_items(data_dict[k], k_item_root, target)
            else:
                item_val = ' : '.join((k, str(data_dict[k])))
                target.AppendItem(root, item_val)
899078
def walk_tree_and_replace(self, data, overrides):
        '''
        
        '''
        if isinstance(data, dict):
            response = {}
            replacements = {}
            # look for id entry
            thisID = data.get('id', None)
            if thisID is not None:
                replacements = overrides.get(thisID, None) if overrides else None
                if not replacements:
                    replacements = self._replacements.get(thisID, {})
            # walk all keys and replace if needed
            for k, v in data.items():
                r = replacements.get(k, None)
                if r is None:
                    r = self.walk_tree_and_replace(v, overrides)
                response[k] = r
            return response
        if isinstance(data, list):
            # process each entry in turn and return
            return [self.walk_tree_and_replace(x, overrides) for x in data]
        return data
612653
public static void replaceDocTree(
      SuggestedFix.Builder fix, DocTreePath docPath, String replacement) {
    DocTree leaf = docPath.getLeaf();
    checkArgument(
        leaf instanceof DCTree.DCEndPosTree, "no end position information for %s", leaf.getKind());
    DCTree.DCEndPosTree<?> node = (DCTree.DCEndPosTree<?>) leaf;
    DCTree.DCDocComment comment = (DCTree.DCDocComment) docPath.getDocComment();
    fix.replace((int) node.getSourcePosition(comment), node.getEndPos(comment), replacement);
  }
1192656
def _replace_placeholder(self, spider):
        
        return self.db_name % {'spider': spider.name}, self.collection_name % {'spider': spider.name}
388802
def append_item(self, item):
        """"""
        if not isinstance(item, LR0Item):
            raise TypeError
        self.itemlist.append(item)
948616
def _set_backreferences(self, context, items, **kwargs):
        

        # Don't set any references during initialization.
        # This might cause a recursion error when calling `getRaw` to fetch the
        # current set UIDs!
        initializing = kwargs.get('_initializing_', False)
        if initializing:
            return

        # UID of the current object
        uid = api.get_uid(context)
        # current set UIDs
        raw = self.getRaw(context) or []
        # handle single reference fields
        if isinstance(raw, basestring):
            raw = [raw, ]
        cur = set(raw)
        # UIDs to be set
        new = set(map(api.get_uid, items))
        # removed UIDs
        removed = cur.difference(new)

        # Unlink removed UIDs from the source
        for uid in removed:
            source = api.get_object_by_uid(uid, None)
            if source is None:
                logger.warn("UID {} does not exist anymore".format(uid))
                continue
            self.unlink_reference(source, context)

        # Link backrefs
        for item in items:
            self.link_reference(item, context)
1071856
def move_to_group(self, items, new_group_id: int):
        
        group = self.rootItem.child(new_group_id)
        for item in items:
            group.appendChild(item)
        self.controller.refresh()
967091
def nested_insert(self, item_list):
        
        if len(item_list) == 1:
            self[item_list[0]] = LIVVDict()
        elif len(item_list) > 1:
            if item_list[0] not in self:
                self[item_list[0]] = LIVVDict()
            self[item_list[0]].nested_insert(item_list[1:])
651921
def replace_nodes(root, old, new):

    '''
     
    '''

    rep = Replacer(old, new)
    rep.visit(root)
    return
1188164
function() {
			var parent = this.parent;
			var ix = parent.children.indexOf(this);
			var items = utils.flatten(arguments);
			spliceFn.apply(parent.children, [ix, 1].concat(items));
			
			// update parent
			items.forEach(function(item) {
				item.parent = parent;
			});
		}
327423
protected function rebuildItemList(?Item $currentItem = null): void
    {
        if (count($this->items) === 0) {
            $this->items = $this->skippedItems;
            $this->skippedItems = new ItemList();
        }

        if ($currentItem instanceof Item) {
            $this->items->insert($currentItem);
        }
    }