Remove indirect children from children list returned from recursive listing.

@param children list from recursive listing
@return trimmed list, null if input is null
172934
private UfsStatus[] trimIndirect(UfsStatus[] children) {
    List<UfsStatus> childrenList = new ArrayList<>();
    for (UfsStatus child : children) {
      int index = child.getName().indexOf(AlluxioURI.SEPARATOR);
      if (index < 0 || index == child.getName().length()) {
        childrenList.add(child);
      }
    }
    return childrenList.toArray(new UfsStatus[childrenList.size()]);
  }
652177
@Override
  public void setChildren(Tree[] children) {
    if (children == null || children.length == 0) {
      this.children = ZERO_TGN_CHILDREN;
    } else {
      if (children instanceof TreeGraphNode[]) {
        this.children = (TreeGraphNode[]) children;
      } else {
        this.children = new TreeGraphNode[children.length];
        for (int i = 0; i < children.length; i++) {
          this.children[i] = (TreeGraphNode)children[i];
        }
      }
    }
  }
107261
@SuppressWarnings("unchecked")
  public void addChildren(List<? extends N> children) {
    // NOTE: if the input list comes from another node, this could cause
    // ConcurrentModificationExceptions as nodes are moved from one parent to another.  To avoid
    // this we make a copy of the input list.
    for (Node child : children.toArray(new Node[0])) {
      addChild((N) child);
    }
  }
1293803
function removeChildren(data = []) {
  const ds = cloneDeep(data);
  ds.forEach((item) => {
    if (item.children) delete item.children;
  });
  return ds;
}
1011745
def recursive_children_removal(found)
      return if found.empty?
      nodes.tap do |ns|
        # found.delete(n.object_id) stops looking for an already found object_id
        ns.delete_if { |n| found.include?(n.object_id) ? found.delete(n.object_id) : false }
        nodes.each do |n|
          n.send(:recursive_children_removal, found) if n.is_a?(Ox::Element)
        end
      end
    end
947962
@Override
    public List<ComponentType> children() {
        synchronized (this) {
            List<ComponentType> children = new ArrayList<ComponentType>();
            for (ComponentVertex child : this.children) {
                children.add(child.component());
            }
            return Collections.unmodifiableList(children);
        }
    }
699628
private static <T extends HierarchyEntity<T, ?>> void loadChildren(T node, Set<T> children) {
    if (null == node.getChildren()) { return; }
    for (T one : node.getChildren()) {
      children.add(one);
      loadChildren(one, children);
    }
  }
1072631
private static List<WComponent> copyChildren(final List<WComponent> children) {
		ArrayList<WComponent> copy;

		if (children == null) {
			copy = new ArrayList<>(1);
		} else {
			copy = new ArrayList<>(children);
		}

		return copy;
	}
669078
public function removeChildren ()
  {
    $children       = $this->children;
    $this->children = [];
    if ($children)
      self::detachAll ($children);
    return $children;
  }
403241
public static void removeRecursive(ResultHierarchy hierarchy, Result child) {
    for(It<Result> iter = hierarchy.iterParents(child); iter.valid(); iter.advance()) {
      hierarchy.remove(iter.get(), child);
    }
    for(It<Result> iter = hierarchy.iterChildren(child); iter.valid(); iter.advance()) {
      removeRecursive(hierarchy, iter.get());
    }
  }
1200127
def _detach_children(self):
        """"""
        children = [val[0] for val in self._children.values()]
        for child in children:
            child()._parent = list(self)
        self._children.clear()
741258
def remove_children(list_of_abspath):
        
        sorted_list_of_abspath = list(list_of_abspath)
        sorted_list_of_abspath.sort()
        sorted_list_of_abspath.append("")  
        res = list()
        temp = sorted_list_of_abspath[0]
        for abspath in sorted_list_of_abspath:
            if temp not in abspath:
                res.append(temp)
                temp = abspath         
        return res
885342
public void removeChild(final Node child) {
        if (child instanceof Level) {
            levels.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else if (child instanceof SpecTopic) {
            removeSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            commonContents.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else {
            nodes.remove(child);
            child.setParent(null);
        }
    }
1001006
function flattenChildren(children) {
  if (children == null) {
    return children;
  }
  var result = {};
  traverseAllChildren(children, flattenSingleChildIntoContext, result);
  return result;
}
64215
public List<CmsRole> getChildren(boolean recursive) {

        List<CmsRole> children = new ArrayList<CmsRole>();
        Iterator<CmsRole> itChildren = m_children.iterator();
        while (itChildren.hasNext()) {
            CmsRole child = itChildren.next();
            if (child.isOrganizationalUnitIndependent()) {
                child = child.forOrgUnit(null);
            } else {
                child = child.forOrgUnit(m_ouFqn);
            }
            children.add(child);
            if (recursive) {
                for (CmsRole grandChild : child.getChildren(true)) {
                    if (!children.contains(grandChild)) {
                        children.add(grandChild);
                    }
                }
            }
        }
        return children;
    }
1205782
public int removeAllChildren( Node node ) throws RepositoryException {
        isNotNull(node, "node");
        int childrenRemoved = 0;
        NodeIterator iter = node.getNodes();
        while (iter.hasNext()) {
            Node child = iter.nextNode();
            child.remove();
            ++childrenRemoved;
        }
        return childrenRemoved;
    }
1014590
public static <T extends MutableTreeNode<T>> void removeChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        int index = parent.getChildren().indexOf(child);
        checkElementIndex(index, parent.getChildren().size());
        parent.removeChild(index);
    }