/*[deutsch]
<p>Liefert einen {@code Stream} aller Nengos in zeitlich aufsteigender Reihenfolge,
die zum angegebenen Selektor passen. </p>

@param   selector    strategy how to select nengos
@return  stream of nengos
192601
public static Stream<Nengo> stream(Selector selector) {

        switch (selector){
            case NORTHERN_COURT:
                return Arrays.stream(NORTHERN_NENGOS);
            default:
                int min = getLowerBound(selector);
                int max = getUpperBound(selector);
                return Arrays.stream(OFFICIAL_NENGOS, min, max + 1);
        }

    }
1098984
public final static Selector getSelector() {
    synchronized (selectors) {
      Selector s = null;
      try {
        if (selectors.size() != 0) {
          s = selectors.pop();
        }
      } catch (EmptyStackException ex) {
      }

      int attempts = 0;
      try {
        while (s == null && attempts < 2) {
          selectors.wait(timeout);
          try {
            if (selectors.size() != 0) {
              s = selectors.pop();
            }
          } catch (EmptyStackException ex) {
            break;
          }
          attempts++;
        }
      } catch (InterruptedException ex) {
      }
      return s;
    }
  }
1313878
function select(selector) {
    var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;

    var selection = root.querySelectorAll(selector);

    return selection.length ? selection : null;
}
518172
public T selector(Map<String, Object> messageSelector) {
        getAction().setMessageSelectorMap(messageSelector);

        return self;
    }
822987
public CompletableFuture<StreamCut> fetchTailStreamCut(final Stream stream) {
        return controller.getCurrentSegments(stream.getScope(), stream.getStreamName())
                         .thenApply(s -> {
                             latestDelegationToken.set(s.getDelegationToken());
                             Map<Segment, Long> pos =
                                     s.getSegments().stream().map(this::segmentToInfo)
                                      .collect(Collectors.toMap(SegmentInfo::getSegment, SegmentInfo::getWriteOffset));
                             return new StreamCutImpl(stream, pos);
                         });
    }
311723
@NotNull
    public static <T> Stream<T> of(@NotNull final T... elements) {
        Objects.requireNonNull(elements);
        if (elements.length == 0) {
            return Stream.<T>empty();
        }
        return new Stream<T>(new ObjArray<T>(elements));
    }
669859
public PythonSplitStream split(OutputSelector<PyObject> output_selector) throws IOException {
		return new PythonSplitStream(this.stream.split(new PythonOutputSelector(output_selector)));
	}
174452
public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
		return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
	}
131783
public static Node selectNode(Node dom, String xpath) {
        return selector.selectNode(dom, xpath);
    }
229101
public final void selector() throws RecognitionException {
		int selector_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 138) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:5: ( '.' methodName ( arguments )? | '.' 'this' | '.' 'super' superSuffix | '.' 'new' ( nonWildcardTypeArguments )? innerCreator | '[' expression ']' )
			int alt189=5;
			int LA189_0 = input.LA(1);
			if ( (LA189_0==47) ) {
				switch ( input.LA(2) ) {
				case 111:
					{
					alt189=2;
					}
					break;
				case 108:
					{
					alt189=3;
					}
					break;
				case 97:
					{
					alt189=4;
					}
					break;
				case Identifier:
				case 75:
				case 90:
				case 95:
				case 103:
				case 117:
					{
					alt189=1;
					}
					break;
				default:
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 189, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
			}
			else if ( (LA189_0==59) ) {
				alt189=5;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 189, 0, input);
				throw nvae;
			}

			switch (alt189) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:7: '.' methodName ( arguments )?
					{
					match(input,47,FOLLOW_47_in_selector6270); if (state.failed) return;
					pushFollow(FOLLOW_methodName_in_selector6272);
					methodName();
					state._fsp--;
					if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:22: ( arguments )?
					int alt187=2;
					int LA187_0 = input.LA(1);
					if ( (LA187_0==36) ) {
						alt187=1;
					}
					switch (alt187) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:23: arguments
							{
							pushFollow(FOLLOW_arguments_in_selector6275);
							arguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1285:9: '.' 'this'
					{
					match(input,47,FOLLOW_47_in_selector6287); if (state.failed) return;
					match(input,111,FOLLOW_111_in_selector6289); if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1286:9: '.' 'super' superSuffix
					{
					match(input,47,FOLLOW_47_in_selector6299); if (state.failed) return;
					match(input,108,FOLLOW_108_in_selector6301); if (state.failed) return;
					pushFollow(FOLLOW_superSuffix_in_selector6303);
					superSuffix();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:9: '.' 'new' ( nonWildcardTypeArguments )? innerCreator
					{
					match(input,47,FOLLOW_47_in_selector6313); if (state.failed) return;
					match(input,97,FOLLOW_97_in_selector6315); if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:19: ( nonWildcardTypeArguments )?
					int alt188=2;
					int LA188_0 = input.LA(1);
					if ( (LA188_0==53) ) {
						alt188=1;
					}
					switch (alt188) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:20: nonWildcardTypeArguments
							{
							pushFollow(FOLLOW_nonWildcardTypeArguments_in_selector6318);
							nonWildcardTypeArguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					pushFollow(FOLLOW_innerCreator_in_selector6322);
					innerCreator();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1288:9: '[' expression ']'
					{
					match(input,59,FOLLOW_59_in_selector6332); if (state.failed) return;
					pushFollow(FOLLOW_expression_in_selector6334);
					expression();
					state._fsp--;
					if (state.failed) return;
					match(input,60,FOLLOW_60_in_selector6336); if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 138, selector_StartIndex); }

		}
	}
828278
public function findElement($strategy, $selector)
	{
		return $this->element($this->using($strategy)->value($selector));
	}
314052
public static ScrollSpy scrollSpy(final String selector) {
        return new ScrollSpy((Element) Document.get().getBody().cast(), selector);
    }
288633
public static Selector getSelector(MutableCallSite callSite, Class sender, String methodName, int callID, boolean safeNavigation, boolean thisCall, boolean spreadCall, Object[] arguments) {
        CALL_TYPES callType = CALL_TYPES_VALUES[callID];
        switch (callType) {
            case INIT: return new InitSelector(callSite, sender, methodName, callType, safeNavigation, thisCall, spreadCall, arguments);
            case METHOD: return new MethodSelector(callSite, sender, methodName, callType, safeNavigation, thisCall, spreadCall, arguments);
            case GET: 
                return new PropertySelector(callSite, sender, methodName, callType, safeNavigation, thisCall, spreadCall, arguments);
            case SET:
                throw new GroovyBugError("your call tried to do a property set, which is not supported.");
            case CAST:  return new CastSelector(callSite, arguments);
            default: throw new GroovyBugError("unexpected call type");
        }
    }
288185
public Selector append(Selector tail) {
        if (right == null) {
            if (combinator != null) {
                throw new IllegalStateException();
            }
            return new Selector(left, null, tail);
        } else {
            return new Selector(left, combinator, right.append(tail));
        }
    }
605791
public @Nonnull Stream<String> value(String xpath) {
        return select(xpath).map(XQuery::text);
    }
278182
public static <T> T findAny( Stream<T> stream, Predicate<T> predicate ) {
        Optional<T> element = stream.filter(predicate).findAny();
        return element.orElse(null);
    }
297985
function(selector) {
        var nodelist = Y.all(Y.Selector.query(selector, this._node));
        nodelist._query = selector;
        nodelist._queryRoot = this._node;
        return nodelist;
    }