Returns a new {@link Gather} that applies a function to each element of this delegate as they are retrieved.
516888
public <R> Gather<R> map(final Function<? super T, ? extends R> function) {
        return from(Iterators.transform(each().iterator(), function));
    }
900306
public static <T> Gather<T> from(Enumeration<T> enumeration) {
		return null == enumeration 
				? Gather.<T>empty() : from(Iterators.forEnumeration(enumeration));
	}
659704
public static <K, E> Map<K, List<E>> groupBy(final Iterable<E> iterable, final Function<E, K> func) {
        final Map<K, List<E>> retVal = newLinkedHashMap();
        for (E e : iterable) {
            final K key = func.apply(e);
            List<E> val;
            if (retVal.containsKey(key)) {
                val = retVal.get(key);
            } else {
                val = newArrayList();
            }
            val.add(e);
            retVal.put(key, val);
        }
        return retVal;
    }
995953
public static <K, V, V2> MutableMap<K, V2> collectValues(
            Map<K, V> map,
            Function2<? super K, ? super V, ? extends V2> function)
    {
        return MapIterate.collectValues(map, function, UnifiedMap.<K, V2>newMap(map.size()));
    }
246086
private void collectAll(MethodProvider methodProvider, Map<String, Invoker> found) {
		// We do this in inverse order as in 'GetMethodLookup'. This is because GetMethodLookup
		// is lazy and wants to stop when a method is found, but here we instead collect
		// everything bottom up and 'overwrite' earlier results so the last one found is the
		// one kept.

		// First interfaces in inverse order...
		MethodProvider[] itfs = methodProvider.getInterfaces();
		for (int i = itfs.length - 1; i >= 0; i--) { // inverse order
			collectAll(itfs[i], found);
		}

		// Then the superclass(es), but only if we're not an interface (interfaces do not report
		// the methods of Object!
		MethodProvider supr = methodProvider.getSuper();
		if (supr != null && !methodProvider.isInterface()) {
			collectAll(supr, found);
		}

		// Finally all our own public methods
		for (Invoker method : methodProvider.getDeclaredMethods()) {
			if (Modifier.isPublic(method.getModifiers())) {
				found.put(method.getName() + method.getMethodDescriptor(), method);
			}
		}
	}
121774
public static <T, NewKey> Map<NewKey, List<T>> groupingBy(List<T> list, Function<T, NewKey> function) {
        return list.stream().collect(Collectors.groupingBy(function, LinkedHashMap::new, mapping(Function.identity(), Collectors.toList())));
    }
1026672
async def gather(self):
        
        if self.__state == 'new':
            self.__setState('gathering')
            await self._connection.gather_candidates()
            self.__setState('completed')
981888
public static <T> ConsoleAnnotator<T> combine(Collection<? extends ConsoleAnnotator<? super T>> all) {
        switch (all.size()) {
        case 0:     return null;    // none
        case 1:     return  cast(all.iterator().next()); // just one
        }

        return new ConsoleAnnotatorAggregator<>(all);
    }
310466
function (selector) {
        var self = this, i, l, matches = [], item, match;

        // Compile string into selector expression
        if (typeof selector === "string") {
          selector = new Selector(selector);

          match = function (item) {
            return selector.match(item);
          };
        } else {
          // Use selector as matching function
          match = selector;
        }

        for (i = 0, l = self.length; i < l; i++) {
          item = self[i];

          if (match(item)) {
            matches.push(item);
          }
        }

        return new Collection(matches);
      }
1163147
function (element, delegate) {
        if (this.eventManager) this.eventManager.unbind();
        this.eventManager = events(this.el, this);
        this.delegateEvents();
        this._applyBindingsForKey();
        return this;
    }
337893
function (el, selector, ev, callback) {
            can.delegate.call(el, selector, ev, callback);
            return function () {
                can.undelegate.call(el, selector, ev, callback);
            };
        }
492320
public static <B> Function<Example<?, B>, B> outputGetter() {
    return new Function<Example<?, B>, B>() {
      @Override
      public B apply(Example<?, B> item) {
        return item.getOutput();
      }
    };
  }
455778
function gather() {
  var codes = {}
  var key

  for (key in doctypes) {
    codes[cleanDoctype(key)] = doctypes[key]
  }

  return codes
}
1219462
public static <T, P, A> Collection<A> collectWith(
            Iterable<T> iterable,
            Function2<? super T, ? super P, ? extends A> function,
            P parameter)
    {
        if (iterable instanceof MutableCollection)
        {
            return ((MutableCollection<T>) iterable).collectWith(function, parameter);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.collectWith((ArrayList<T>) iterable, function, parameter);
        }
        if (iterable instanceof List<?>)
        {
            return ListIterate.collectWith((List<T>) iterable, function, parameter);
        }
        if (iterable instanceof Collection)
        {
            return IterableIterate.collectWith(
                    iterable,
                    function,
                    parameter,
                    DefaultSpeciesNewStrategy.INSTANCE.<A>speciesNew(
                            (Collection<T>) iterable,
                            ((Collection<T>) iterable).size()));
        }
        if (iterable != null)
        {
            return IterableIterate.collectWith(iterable, function, parameter);
        }
        throw new IllegalArgumentException("Cannot perform a collectWith on null");
    }
89913
function groupBy(keySelector, elementSelector, resultSelector, keyComparator) {
                __assertFunction(keySelector);
                __assertFunction(elementSelector);
                __assert(__isUndefined(resultSelector) || __isFunction(resultSelector), 'resultSelector must be undefined or function!');
                __assertFunction(keyComparator);
                var groups = new Map();
                var result = void 0;
                var _iteratorNormalCompletion13 = true;
                var _didIteratorError13 = false;
                var _iteratorError13 = undefined;

                try {
                    for (var _iterator13 = self[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {
                        var val = _step13.value;

                        // Instead of checking groups.has we use our custom function since we want to treat some keys as equal even if they aren't for the Map
                        var key = __Collection.__getEqualKey(groups, keySelector(val), keyComparator);
                        var elem = elementSelector(val);
                        if (groups.has(key)) {
                            groups.get(key).push(elem);
                        } else {
                            groups.set(key, [elem]);
                        }
                    }
                } catch (err) {
                    _didIteratorError13 = true;
                    _iteratorError13 = err;
                } finally {
                    try {
                        if (!_iteratorNormalCompletion13 && _iterator13.return) {
                            _iterator13.return();
                        }
                    } finally {
                        if (_didIteratorError13) {
                            throw _iteratorError13;
                        }
                    }
                }

                if (resultSelector) {
                    // If we want to select the final result with the resultSelector, we use the built-in Select function and retrieve a new Collection
                    result = __Collection.from(groups).select(function (g) {
                        return resultSelector.apply(undefined, _toConsumableArray(g));
                    });
                } else {
                    // our result is just the groups -> return the Map
                    result = groups;
                }
                return result;
            }
703934
function(element, selector, event, callback, capturePhase) {
    const delegateElement = $(element).array[0]
    $(element).forEach(function(ctx) {
      $(ctx).on(event, function(e) {
        let target = e.target
        if (e.target.nodeType === 3) {
          target = e.target.parentNode
        }
        $(ctx).find(selector).forEach(function(delegateElement) {
          if (delegateElement === target) {
            callback.call(delegateElement, e)
          } else {
            try {
              const ancestor = $(target).closest(selector)
              if (delegateElement === ancestor.array[0]) {
                callback.call(delegateElement, e)
              }
            } catch (err) {}
          }
        })
      }, capturePhase)
    })
  }
441307
public static <T, V> LazyIterable<V> collect(
            Iterable<T> iterable,
            Function<? super T, ? extends V> function)
    {
        return new CollectIterable<T, V>(iterable, function);
    }