This method performs a depth-first search for the given uid in the dictionary of results.
559437
def _find_id(self, result, uid):
        
        # if the result is a list
        if isinstance(result, list):
            # if the list has a valid entry
            if any([self._find_id(value, uid) for value in result]):
                # then we're done
                return True

        # otherwise results could be dictionaries
        if isinstance(result, dict):
            # the children of the result that are lists
            list_children = [value for value in result.values() if isinstance(value, list)]

            # go to every value that is a list
            for value in list_children:
                # if the value is a match
                if self._find_id(value, uid):
                    # we're done
                    return True

            # the children of the result that are dicts
            dict_children = [value for value in result.values() if isinstance(value, dict)]

            # perform the check on every child that is a dict
            for value in dict_children:
                # if the child is a match
                if self._find_id(value, uid):
                    # we're done
                    return True

            # if there are no values that are lists and there is an id key
            if not list_children and not dict_children and 'id' in result:
                # the value of the remote id field
                result_id = result['id']
                # we've found a match if the id field matches (cast to match type)
                return result_id == type(result_id)(uid)

        # we didn't find the result
        return False
1224165
def lookup_search_result(self, result, **kw):
        """"""
        return self.lookup(s['id_str'] for s in result['statuses'], **kw)
290761
def _do_search(self):
        
        if self._results_cache is None:
            response = self.raw()
            results = self.to_python(response.get('hits', {}).get('hits', []))
            self._results_cache = DictSearchResults(
                self.type, response, results, None)
        return self._results_cache
296707
def get_all(self, uids: Iterable[int]) -> Mapping[int, Record]:
        
        return {uid: self._records[uid] for uid in uids
                if uid in self._records}
670437
def identifierSearches(self,
                           ids=None,
                           LIMIT=25,
                           _print=True,
                           crawl=False):
        """"""
        url_base = self.base_url + '/api/1/term/view/{id}' + '?key=' + self.api_key
        urls = [url_base.format(id=str(_id)) for _id in ids]
        return self.get(
            urls=urls,
            LIMIT=LIMIT,
            action='Searching For Terms',
            crawl=crawl,
            _print=_print)
488201
private void findMatchingValues(NavigableMap<Endpoint, Integer> map, Endpoint endpoint, List<UUID> result) {
        // Mark this endpoint as a marker, because it is used to do a tailMap traversal to query matching edges
        endpoint.setMarker();
        
        // Find the first key 
        Endpoint floorKey = map.floorKey(endpoint);
        
        Map<Endpoint, Integer> view;
        if (floorKey == null) {
            // This means that the element being searched is the minimum
            view = map;
        } else {
            view = map.tailMap(floorKey);
        }
        
        boolean isFirst = true;
        for (Map.Entry<Endpoint, Integer> entry : view.entrySet()) {
            Endpoint key = entry.getKey();

            if (endpoint.isMatch(key)) {
                // Matching entry, must be added to result
                result.add(key.getEdgeId());
            } else {
                // Done with the search -- the tree map is sorted
                
                if (isFirst) {
                    // continue
                } else {
                    break;
                }
            }
            
            isFirst = false;
        }
    }
1323509
function searchObject(object, filter, maxDepth, depth) {
        if (maxDepth === void 0) { maxDepth = -1; }
        if (depth === void 0) { depth = 0; }
        // avoid inifinite recursion...
        if ((maxDepth > 0 && depth >= maxDepth) || depth > 50) {
            return false;
        }
        var f = filter.toLowerCase();
        var answer = false;
        if (angular.isString(object)) {
            answer = object.toLowerCase().indexOf(f) !== -1;
        }
        else if (angular.isNumber(object)) {
            answer = ("" + object).toLowerCase().indexOf(f) !== -1;
        }
        else if (angular.isArray(object)) {
            answer = _.some(object, function (item) { return searchObject(item, f, maxDepth, depth + 1); });
        }
        else if (angular.isObject(object)) {
            answer = searchObject(_.values(object), f, maxDepth, depth);
        }
        return answer;
    }
768061
function forwardSearch() {
      cameFrom = open1Set.pop();
      if (cameFrom.closed) {
        return;
      }

      cameFrom.closed = true;

      if (cameFrom.f1 < lMin && (cameFrom.g1 + f2 - heuristic(from, cameFrom.node)) < lMin) {
        graph.forEachLinkedNode(cameFrom.node.id, forwardVisitor);
      }

      if (open1Set.length > 0) {
        // this will be used in reverse search
        f1 = open1Set.peek().f1;
      } 
    }
770395
public Object lookup(String id,StringWrapper toFind)
    {
	doLookup(id,toFind);
	return closestMatch;
    }
582322
function deepFirstFindNav_(widget,groundId) {
  var compObj = widget.component;
  if (!compObj) return null;
  
  for (var sKey in compObj.$gui.compIdx) {
    var child = widget[sKey];
    var childObj = child && child.component;
    if (!childObj) continue;
    
    if (childObj.props['isNavigator.']) {
      var d = childObj.$gui.navItems;
      var ele = d && d[groundId];
      if (ele && ele.props['isPlayground.']) return child;
    }
    else {
      if (!childObj.props['childInline.']) {
        child = deepFirstFindNav_(child,groundId)
        if (child) return child;
      }
    }
  }
  
  return null;
}
151278
def uid(self, p_todo):
        
        try:
            return self._todo_id_map[p_todo]
        except KeyError as ex:
            raise InvalidTodoException from ex
150466
def containsUid(self, uid):
        '''
            
        '''
        for rootNode in self.getRootNodes():
            if rootNode.containsUid(uid):
                return True

        return False
267310
public void search() {
		if (layer != null) {
			// First we try to get the list of criteria:
			List<SearchCriterion> criteria = getSearchCriteria();
			if (criteria != null && !criteria.isEmpty()) {
				SearchFeatureRequest request = new SearchFeatureRequest();
				String value = (String) logicalOperatorRadio.getValue();
				if (value.equals(I18nProvider.getSearch().radioOperatorAnd())) {
					request.setBooleanOperator("AND");
				} else {
					request.setBooleanOperator("OR");
				}
				request.setCriteria(criteria.toArray(new SearchCriterion[criteria.size()]));
				request.setCrs(mapModel.getCrs());
				request.setLayerId(layer.getServerLayerId());
				request.setMax(maximumResultSize);
				request.setFilter(layer.getFilter());
				request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());

				GwtCommand command = new GwtCommand(SearchFeatureRequest.COMMAND);
				command.setCommandRequest(request);
				GwtCommandDispatcher.getInstance().execute(command,
						new AbstractCommandCallback<SearchFeatureResponse>() {

					public void execute(SearchFeatureResponse response) {
						List<Feature> features = new ArrayList<Feature>();
						for (org.geomajas.layer.feature.Feature dtoFeature : response.getFeatures()) {
							Feature feature = new Feature(dtoFeature, layer);
							layer.getFeatureStore().addFeature(feature);
							features.add(feature);
						}
						SearchEvent event = new SearchEvent(layer, features);
						FeatureSearch.this.fireEvent(event);
					}
				});
			}
		}
	}
1133439
def put(self, uid):
        

        resource_data = self.request.json

        try:
            record = resource_db[uid]

        except KeyError:
            return self.response_factory.not_found(errors=['Resource with UID {} does not exist!'])

        record['name'] = resource_data.get('name')

        return self.response_factory.ok(data=record)
1052882
def _pass_uid(self):
        

        for task in self._tasks:
            task.parent_stage['uid'] = self._uid
            task.parent_stage['name'] = self._name
            task.parent_pipeline['uid'] = self._p_pipeline['uid']
            task.parent_pipeline['name'] = self._p_pipeline['name']
1001134
private void depthFirstSearch(final Range<C> query, final Node node, final List<Range<C>> result, final Set<Node> visited) {
        if (node == null || visited.contains(node) || query.isEmpty()) {
            return;
        }
        if (node.left() != null && Ranges.isLessThan(query, node.center())) {
            depthFirstSearch(query, node.left(), result, visited);
        }
        else if (node.right() != null && Ranges.isGreaterThan(query, node.center())) {
            depthFirstSearch(query, node.right(), result, visited);
        }
        if (Ranges.isGreaterThan(query, node.center())) {
            for (Range<C> range : node.overlapByUpperEndpoint()) {
                if (Ranges.intersect(range, query)) {
                    result.add(range);
                }
                if (Ranges.isGreaterThan(query, range.upperEndpoint())) {
                    break;
                }
            }
        }
        else if (Ranges.isLessThan(query, node.center())) {
            for (Range<C> range : node.overlapByLowerEndpoint()) {
                if (Ranges.intersect(range, query)) {
                    result.add(range);
                }
                if (Ranges.isLessThan(query, range.lowerEndpoint())) {
                    break;
                }
            }
        }
        else {
            result.addAll(node.overlapByLowerEndpoint());
        }
        visited.add(node);
    }
310905
def _retrieve(self, uid):
        """"""
        query = dict(uid=uid)
        doc = self.db.pastes.find_one(query)
        if 'data_id' in doc:
            data_id = doc.pop('data_id')
            gfs = gridfs.GridFS(self.db)
            doc.update(data=gfs.get(data_id).read())
        return doc