Perform a search and return the names of the nodes that match the search.
778210
def perform_search(type, query)
      Chef::Search::Query.new.search(type, query).first.map(&:name)
    end
934778
def getAllNodes(self):
        '''
            
        '''

        ret = TagCollection()

        for rootNode in self.getRootNodes():
            ret.append(rootNode)

            ret += rootNode.getAllChildNodes()

        return ret
1028082
def filter_nodes(n: Node, query: str) -> CompatNodeIterator:
    
    return CompatNodeIterator(filter(n, query)._nodeit, only_nodes=True)
1365554
def _get_subset_matches(self, query):
        
        for field_name, db_index in self._get_db_fields(query):
            attr = getattr(query, field_name)

            if attr is None:  # don't use unset attributes
                continue

            results = db_index.get(attr, OOTreeSet())

            if results:
                yield results
1061671
def getRequiredNodes(self):
        
        return {nodeShape:len(self.nodeReservations[nodeShape]) for nodeShape in self.nodeShapes}
503071
def filter(n: Node, query: str) -> CompatNodeIterator:
    
    ctx = uast()
    return CompatNodeIterator(NodeIterator(ctx.filter(query, n.internal_node), ctx))
1240839
def find_best_matching_node(self, new, old_nodes):
        
        name = new.__class__.__name__
        #: TODO: We should pick the BEST one from this list
        #: based on some "matching" criteria (such as matching ref name or params)
        matches = [c for c in old_nodes if name == c.__class__.__name__]
        if self.debug:
            print("Found matches for {}: {} ".format(new, matches))
        return matches[0] if matches else None
2744
def iter_search_nodes(self, **conditions):
        
        for n in self.traverse():
            conditions_passed = 0
            for key, value in six.iteritems(conditions):
                if hasattr(n, key) and getattr(n, key) == value:
                    conditions_passed +=1
            if conditions_passed == len(conditions):
                yield n
290122
def _list_nodes(full=False, for_output=False):
    '''
    
    '''
    fetch = True
    page = 1
    ret = {}

    while fetch:
        items = query(method='droplets',
                      command='?page=' + six.text_type(page) + '&per_page=200')
        for node in items['droplets']:
            name = node['name']
            ret[name] = {}
            if full:
                ret[name] = _get_full_output(node, for_output=for_output)
            else:
                public_ips, private_ips = _get_ips(node['networks'])
                ret[name] = {
                    'id': node['id'],
                    'image': node['image']['name'],
                    'name': name,
                    'private_ips': private_ips,
                    'public_ips': public_ips,
                    'size': node['size_slug'],
                    'state': six.text_type(node['status']),
                }

        page += 1
        try:
            fetch = 'next' in items['links']['pages']
        except KeyError:
            fetch = False

    return ret
499493
def get_many(self, uris):
        
        nodes = {}

        for uri in uris:
            try:
                node = self.get(uri)
            except NodeDoesNotExist:
                continue
            else:
                nodes[uri] = node

        return nodes
1333888
def _recursive_matches(self, nodes, count):
        """"""
        assert self.content is not None
        if count >= self.min:
            yield 0, {}
        if count < self.max:
            for alt in self.content:
                for c0, r0 in generate_matches(alt, nodes):
                    for c1, r1 in self._recursive_matches(nodes[c0:], count+1):
                        r = {}
                        r.update(r0)
                        r.update(r1)
                        yield c0 + c1, r
1251275
public List<Node> searchSubtree(Dn parent) throws NoSuchNodeException, MissingParentException {
        SearchCursor cursor = searchOneLevel(parent);
        return extractNodesFromCursor(cursor);
    }
1331510
public List<String> suggestTagNames(final String search,
      final int max_results) {
    return tag_names.suggest(search, max_results);
  }
416332
@Action(semantics = SemanticsOf.SAFE)
    public List<ApplicationTenancy> findMatching(final String search) {
        if (search != null && search.length() > 0) {
            return findByNameOrPathMatching(search);
        }
        return Lists.newArrayList();
    }
781745
def get_all_nodes(self):
        
        nodes = self.nodes.values()
        if nodes:
            return reduce(operator.add, nodes, list())
        else:
            return []
1014499
async def _nodes_found(self, responses):
        
        toremove = []
        for peerid, response in responses.items():
            response = RPCFindResponse(response)
            if not response.happened():
                toremove.append(peerid)
            else:
                self.nearest.push(response.get_node_list())
        self.nearest.remove(toremove)

        if self.nearest.have_contacted_all():
            return list(self.nearest)
        return await self.find()
105083
def match(self, string):
        
        m = self._re.match(string)

        if m:
            return Match(string, [(self._re, m)], self._group_names_to_nodes, self.unescape_funcs)