find child beans, including those in collections
766139
private void findChildBeans(Object obj, MetaProperty<?> mp, Class<?> beanClass, Deque<Bean> temp) {
        if (obj != null) {
            if (obj instanceof Bean) {
                temp.addFirst((Bean) obj);
            } else {
                SerIterator it = SerIteratorFactory.INSTANCE.create(obj, mp, beanClass);
                if (it != null) {
                    while (it.hasNext()) {
                        it.next();
                        findChildBeans(it.key(), mp, Object.class, temp);
                        findChildBeans(it.value(), mp, Object.class, temp);
                        findChildBeans(it.column(), mp, Object.class, temp);
                    }
                }
            }
        }
    }
84020
function visit(collection, pattern, address) {
                collection = collection || [];
                var foundSoFar = false;

                collection.forEach(function (collectionItem) {
                    foundSoFar = foundSoFar || testForField(collectionItem, pattern, address);
                });

                return foundSoFar;
            }
1276473
@Override
	public Map<String, Object> getChildren(Boolean includeInheritedFields)
	{
		Map<String, Object> fields = new HashMap<String, Object>();
		if (includeInheritedFields)
		{
			fields.putAll(super.getChildren(includeInheritedFields));
		}
		fields.put("unicode", this.unicode);
		return fields;
	}
1060774
@Override
    public Set<Span> getChildren(String tenant, String id) {
        if (id == null) {
            throw new NullPointerException("Id should not be null!");
        }

        Set<Span> children = childrenCache.get(id);

        return children == null ? null : Collections.unmodifiableSet(children);
    }
1077367
def get_item_children(item):
    """"""
    children = [item.child(index) for index in range(item.childCount())]
    for child in children[:]:
        others = get_item_children(child)
        if others is not None:
            children += others
    return sorted(children, key=lambda child: child.line)
1122772
function findAll (tree, test) {
  var found = test(tree) ? [tree] : []
  if (isNode(tree)) {
    if (tree.children.length > 0) {
      tree.children.forEach(function (child) {
        found = found.concat(findAll(child, test))
      })
    }
  }

  return found
}
370162
def get_children(self):
        
        for field in self._astroid_fields:
            attr = getattr(self, field)
            if attr is None:
                continue
            if isinstance(attr, (list, tuple)):
                yield from attr
            else:
                yield attr
1089548
def MultiListChildren(self, urns):
    """"""
    result = {}
    not_listed_urns = []

    for urn in urns:
      try:
        result[urn] = self._children_lists_cache[urn]
      except KeyError:
        not_listed_urns.append(urn)

    if not_listed_urns:
      for urn, children in FACTORY.MultiListChildren(not_listed_urns):
        result[urn] = self._children_lists_cache[urn] = children

      for urn in not_listed_urns:
        self._children_lists_cache.setdefault(urn, [])
        result.setdefault(urn, [])

    return result
1285144
public <T extends ElementBase> Iterable<T> getChildren(Class<T> clazz) {
        return MiscUtil.iterableForType(children, clazz);
    }
863034
def _get_children(node, contexts=False, restrict=None, parent=None):
        """"""
        yield (parent, node) if contexts else node
        if restrict and isinstance(node, restrict):
            return
        for code in node.__children__():
            for child in code.nodes:
                sub = Wikicode._get_children(child, contexts, restrict, code)
                for result in sub:
                    yield result
1153333
def get_items(self):
        """"""
        itemlist = []
        def add_to_itemlist(item):
            for index in range(item.childCount()):
                citem = item.child(index)
                itemlist.append(citem)
                add_to_itemlist(citem)
        for tlitem in self.get_top_level_items():
            add_to_itemlist(tlitem)
        return itemlist
1089026
private List<Bean> findReferences(BeanId reference, Collection<Bean> predecessors,
            ArrayList<Bean> matches, ArrayList<Bean> checked) {

        for (Bean predecessor : predecessors) {
            findReferences(reference, predecessor, matches, checked);
        }
        return matches;
    }
1220393
function (cb) {
      Model.findById(parentPk, { include: [{ all : true }]}).then(function(parentRecord) {
        if (!parentRecord) return cb({status: 404});
        if (!parentRecord[relation]) { return cb({status: 404}); }
        cb(null, parentRecord);
      }).catch(function(err){
        return cb(err);
      });
    }
821218
def _get_children(self, node):
        """"""
        children = ast.get_children(node)
        return [child for child in children
                if not isinstance(child, ast.expr_context)]
621744
def get_collections(self, pattern="*", libtype="*"):
        """"""

        sql = """SELECT collection.collection_id, collection.name, collection.doc,
                        collection.type, collection.path
                 FROM collection_table as collection
                 WHERE name like ?
                 AND type like ?
                 ORDER BY collection.name
              """

        cursor = self._execute(sql, (self._glob_to_sql(pattern),
                                     self._glob_to_sql(libtype)))
        sql_result = cursor.fetchall()

        return [{"collection_id": result[0],
                 "name": result[1],
                 "synopsis": result[2].split("\n")[0],
                 "type": result[3],
                 "path": result[4]
             } for result in sql_result]
1073705
function getCollection(items, query, cb, argsLength) {
  var skip = 0, limit = Number.MAX_SAFE_INTEGER;
  setImmediate(function() {
    if (argsLength === 1) {
      cb = query;
    } else {
      skip = (query.skip) ? query.skip : 0;
      limit = (query.limit) ? query.limit : Number.MAX_SAFE_INTEGER;
    }
    var sortedKeys = Object.keys(items);
    var qKeys = remove(remove(Object.keys(query), /skip/), /limit/);
    qKeys.forEach(function (k) {
      try {
        var re = new RegExp(query[k]);
        sortedKeys = sortedKeys.filter(function (l) {
          return items[l][k].toString().match(re);
        });
      } catch (e) {
        console.error(`Problem filtering collection for parameter ${k}.`,
          e.message);
      }
    });
    skip = checkSkip(skip, sortedKeys);
    limit = checkLimit(limit, sortedKeys);
    if (sortedKeys.length === 0 || limit === 0 || skip >= sortedKeys.length) {
      return cb(null, [], sortedKeys.length, 1, 1, 0);
    }
    var pages = Math.ceil(sortedKeys.length / limit);
    var pageOf = Math.ceil(skip / limit) + 1;
    var itemArray = new Array();
    for ( var x = skip ; x < Math.min(skip + limit, sortedKeys.length) ; x++ ) {
      itemArray.push(items[sortedKeys[x]]);
    }
    cb(null, itemArray, sortedKeys.length, pageOf, pages, itemArray.length);
  });
}
1080958
def findItemsByState( self, state ):
        
        out = []
        if ( self.hasRecordState(state) ):
            out.append(self)
        
        for c in range(self.childCount()):
            out += self.child(c).findItemsByState(state)
        
        return out