A thin wrapper layer over {@link DataStream#keyBy(KeySelector)}.

@param selector The KeySelector to be used for extracting the key for partitioning
@return The {@link PythonDataStream} with partitioned state (i.e. {@link PythonKeyedStream})
174452
public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
		return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
	}
76316
static Selector getTemporarySelector(SelectableChannel sc)
        throws IOException
    {
        SoftReference<SelectorWrapper> ref = localSelector.get();
        SelectorWrapper selWrapper = null;
        Selector sel = null;
        if (ref == null
            || ((selWrapper = ref.get()) == null)
            || ((sel = selWrapper.get()) == null)
            || (sel.provider() != sc.provider())) {
            sel = sc.provider().openSelector();
            selWrapper = new SelectorWrapper(sel);
            localSelector.set(new SoftReference<SelectorWrapper>(selWrapper));
        }
        localSelectorWrapper.set(selWrapper);
        return sel;
    }
1050740
protected List<Element> select(String selector, Element context) {

        NodeList<Element> elements = CmsDomUtil.querySelectorAll(selector, context);
        List<Element> result = new ArrayList<Element>();
        for (int i = 0; i < elements.getLength(); i++) {
            result.add(elements.getItem(i));
        }
        return result;
    }
303195
public static streamselector get(nitro_service service, String name) throws Exception{
		streamselector obj = new streamselector();
		obj.set_name(name);
		streamselector response = (streamselector) obj.get_resource(service);
		return response;
	}
485640
private static <T, K> MapOperatorBase<Tuple2<K, T>, T, ?> translateSelectorFunctionReducer(Keys.SelectorFunctionKeys<T, ?> rawKeys,
			ReduceFunction<T> function, TypeInformation<T> inputType, String name, Operator<T> input, int dop)
	{
		@SuppressWarnings("unchecked")
		final Keys.SelectorFunctionKeys<T, K> keys = (Keys.SelectorFunctionKeys<T, K>) rawKeys;
		
		TypeInformation<Tuple2<K, T>> typeInfoWithKey = new TupleTypeInfo<Tuple2<K, T>>(keys.getKeyType(), inputType);
		
		KeyExtractingMapper<T, K> extractor = new KeyExtractingMapper<T, K>(keys.getKeyExtractor());
		
		PlanUnwrappingReduceOperator<T, K> reducer = new PlanUnwrappingReduceOperator<T, K>(function, keys, name, inputType, typeInfoWithKey);
		
		MapOperatorBase<T, Tuple2<K, T>, GenericMap<T, Tuple2<K, T>>> keyExtractingMap = new MapOperatorBase<T, Tuple2<K, T>, GenericMap<T, Tuple2<K, T>>>(extractor, new UnaryOperatorInformation<T, Tuple2<K, T>>(inputType, typeInfoWithKey), "Key Extractor");
		MapOperatorBase<Tuple2<K, T>, T, GenericMap<Tuple2<K, T>, T>> keyRemovingMap = new MapOperatorBase<Tuple2<K, T>, T, GenericMap<Tuple2<K, T>, T>>(new KeyRemovingMapper<T, K>(), new UnaryOperatorInformation<Tuple2<K, T>, T>(typeInfoWithKey, inputType), "Key Extractor");

		keyExtractingMap.setInput(input);
		reducer.setInput(keyExtractingMap);
		keyRemovingMap.setInput(reducer);
		
		// set dop
		keyExtractingMap.setDegreeOfParallelism(input.getDegreeOfParallelism());
		reducer.setDegreeOfParallelism(dop);
		keyRemovingMap.setDegreeOfParallelism(dop);
		
		return keyRemovingMap;
	}
871976
public Selector getSelector(String selector) 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass,
               "getSelector",
               "selector: " + selector);	  
  	// Start by parsing the selector expression (in-line for the moment)
  	selOperands = new ArrayList();
    // We'll Construct a selector tree
    Selector selectorTree = null;
    
    try
    {
      parseSelector(selector);

      Selector[] selectorArray = new Selector[selOperands.size()];
      selOperands.toArray(selectorArray);
 	
      // Iterate over the nodes that were passed into us
      for(int i = selectorArray.length - 1 ; i>=0; i--)
      {
        Selector parsedSelector = (Selector)selectorArray[i];
        if(selectorTree == null)
          selectorTree = parsedSelector;
        else
          selectorTree = matching.createExtensionOperator(Selector.AND, parsedSelector, selectorTree);
      }
    }
    catch(InvalidXPathSyntaxException iex)
    {
      // No FFDC Code Needed.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        tc.debug(this,cclass, "getSelector", iex);   

      // Attempt to parse the entire selector expression. If that fails, then
      // we really can despair of handling this expression.
      selectorTree = parseWholeSelector(selector);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(this,cclass, "getSelector", selectorTree);  
    
    return selectorTree;
  }
313541
function(selector,options) {
      var data = {};
      var elm = this.find(selector);
      if (elm.length) {
        Object.keys(options).forEach(function(key) {
          if (factory.isString(options[key])) {
            data[key] = elm.scrape(options[key]);
          } else {
            data[key] = elm.map(function() {
              return this.scrape(options[key]);
            }).filter(function(item) {
              return Object.keys(item).length;
            });
          }
        });
      }
      return data;
    }
917656
def parse_selector(self, selector):
        
        tag, klass = self.selector_re.match(selector).groups()
        return Selector(tag, klass)
467766
function (selector) {
        var match = this.match;

        function compileNameFilter(name) {
          if (name) {
            name = name.toLowerCase();

            return function (item) {
              return name === '*' || item.type === name;
            };
          }
        }

        function compileIdFilter(id) {
          if (id) {
            return function (item) {
              return item._name === id;
            };
          }
        }

        function compileClassesFilter(classes) {
          if (classes) {
            classes = classes.split('.');

            return function (item) {
              var i = classes.length;

              while (i--) {
                if (!item.classes.contains(classes[i])) {
                  return false;
                }
              }

              return true;
            };
          }
        }

        function compileAttrFilter(name, cmp, check) {
          if (name) {
            return function (item) {
              var value = item[name] ? item[name]() : '';

              return !cmp ? !!check :
                cmp === "=" ? value === check :
                  cmp === "*=" ? value.indexOf(check) >= 0 :
                    cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 :
                      cmp === "!=" ? value != check :
                        cmp === "^=" ? value.indexOf(check) === 0 :
                          cmp === "$=" ? value.substr(value.length - check.length) === check :
                            false;
            };
          }
        }

        function compilePsuedoFilter(name) {
          var notSelectors;

          if (name) {
            name = /(?:not\((.+)\))|(.+)/i.exec(name);

            if (!name[1]) {
              name = name[2];

              return function (item, index, length) {
                return name === 'first' ? index === 0 :
                  name === 'last' ? index === length - 1 :
                    name === 'even' ? index % 2 === 0 :
                      name === 'odd' ? index % 2 === 1 :
                        item[name] ? item[name]() :
                          false;
              };
            }

            // Compile not expression
            notSelectors = parseChunks(name[1], []);

            return function (item) {
              return !match(item, notSelectors);
            };
          }
        }

        function compile(selector, filters, direct) {
          var parts;

          function add(filter) {
            if (filter) {
              filters.push(filter);
            }
          }

          // Parse expression into parts
          parts = expression.exec(selector.replace(whiteSpace, ''));

          add(compileNameFilter(parts[1]));
          add(compileIdFilter(parts[2]));
          add(compileClassesFilter(parts[3]));
          add(compileAttrFilter(parts[4], parts[5], parts[6]));
          add(compilePsuedoFilter(parts[7]));

          // Mark the filter with pseudo for performance
          filters.pseudo = !!parts[7];
          filters.direct = direct;

          return filters;
        }

        // Parser logic based on Sizzle by John Resig
        function parseChunks(selector, selectors) {
          var parts = [], extra, matches, i;

          do {
            chunker.exec("");
            matches = chunker.exec(selector);

            if (matches) {
              selector = matches[3];
              parts.push(matches[1]);

              if (matches[2]) {
                extra = matches[3];
                break;
              }
            }
          } while (matches);

          if (extra) {
            parseChunks(extra, selectors);
          }

          selector = [];
          for (i = 0; i < parts.length; i++) {
            if (parts[i] != '>') {
              selector.push(compile(parts[i], [], parts[i - 1] === '>'));
            }
          }

          selectors.push(selector);

          return selectors;
        }

        this._selectors = parseChunks(selector, []);
      }
130329
public static <T extends ContentMeta> ResourceSelector<T> allResourceSelector() {
        return new ResourceSelector<T>() {
            @Override
            public boolean matchesContent(T content) {
                return true;
            }
        };
    }
369493
public static base_response add(nitro_service client, streamselector resource) throws Exception {
		streamselector addresource = new streamselector();
		addresource.name = resource.name;
		addresource.rule = resource.rule;
		return addresource.add_resource(client);
	}
829834
def subset(self, selector):
        
        if isinstance(selector, (list, tuple)):
            return map(int, selector)
        selector = SELECTORS.get(selector, selector)
        mdtop = MDTrajTopology.from_openmm(self.handler.topology)
        return mdtop.select(selector)
736503
function(selector) {
            selector = selector || '';
            selector = Selector._replaceShorthand(Y.Lang.trim(selector)); 
            var token = Selector._getToken(),     // one token per simple selector (left selector holds combinator)
                query = selector, // original query for debug report
                tokens = [],    // array of tokens
                found = false,  // whether or not any matches were found this pass
                match,         // the regex match
                test,
                i, parser;

            /*
                Search for selector patterns, store, and strip them from the selector string
                until no patterns match (invalid selector) or we run out of chars.

                Multiple attributes and pseudos are allowed, in any order.
                for example:
                    'form:first-child[type=button]:not(button)[lang|=en]'
            */
            outer:
            do {
                found = false; // reset after full pass
                for (i = 0; (parser = Selector._parsers[i++]);) {
                    if ( (match = parser.re.exec(selector)) ) { // note assignment
                        if (parser.name !== COMBINATOR ) {
                            token.selector = selector;
                        }
                        selector = selector.replace(match[0], ''); // strip current match from selector
                        if (!selector.length) {
                            token.last = true;
                        }

                        if (Selector._attrFilters[match[1]]) { // convert class to className, etc.
                            match[1] = Selector._attrFilters[match[1]];
                        }

                        test = parser.fn(match, token);
                        if (test === false) { // selector not supported
                            found = false;
                            break outer;
                        } else if (test) {
                            token.tests.push(test);
                        }

                        if (!selector.length || parser.name === COMBINATOR) {
                            tokens.push(token);
                            token = Selector._getToken(token);
                            if (parser.name === COMBINATOR) {
                                token.combinator = Y.Selector.combinators[match[1]];
                            }
                        }
                        found = true;
                    }
                }
            } while (found && selector.length);

            if (!found || selector.length) { // not fully parsed
                tokens = [];
            }
            return tokens;
        }
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); }

		}
	}
930201
public static nslimitselector get(nitro_service service, String selectorname) throws Exception{
		nslimitselector obj = new nslimitselector();
		obj.set_selectorname(selectorname);
		nslimitselector response = (nslimitselector) obj.get_resource(service);
		return response;
	}
557722
function selectorQuerySpy(results, selector) {
        var context = phantomas.getDOMPath(this);

        phantomas.incrMetric('DOMqueriesByQuerySelectorAll');
        phantomas.addOffender('DOMqueriesByQuerySelectorAll', {selector, node: context});
        querySpy('selector', selector, 'querySelectorAll', context, (results === null || results.length === 0));
    }
1342342
public SelectorDomain getSelectorDomain()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getSelectorDomain");
      SibTr.exit(tc, "getSelectorDomain", domain);
    }
    return domain;
  }