Flattens an iterable of iterables returning a new Enumerable
        :param func: selector as lambda expression
        :return: new Enumerable object
358236
def select_many(self, func=lambda x: x):
        
        return Enumerable3(itertools.chain.from_iterable(self.select(func)))
19686
def _convert_iterable(self, iterable):
        
        # Return original if _wrapper isn't callable
        if not callable(self._wrapper):
            return iterable

        return [self._wrapper(x) for x in iterable]
901696
def generative(func):
    
    def wrap(inst, *args, **kw):
        clone = type(inst).__new__(type(inst))
        clone.__dict__ = inst.__dict__.copy()
        return func(clone, *args, **kw)
    return update_wrapper(wrap, func)
694525
public static <T, U> Collector<T, ?, Seq<T>> modeAllBy(Function<? super T, ? extends U> function) {
        return Collector.of(
            () -> new LinkedHashMap<U, List<T>>(),
            (m, t) -> m.compute(function.apply(t), (k, l) -> {
                List<T> result = l != null ? l : new ArrayList<>();
                result.add(t);
                return result;
            }),
            (m1, m2) -> {
                for (Entry<U, List<T>> e : m2.entrySet()) {
                    List<T> l = m1.get(e.getKey());

                    if (l == null)
                        m1.put(e.getKey(), e.getValue());
                    else
                        l.addAll(e.getValue());
                }

                return m1;
            },
            m -> Seq.seq(m).maxAllBy(t -> t.v2.size()).flatMap(t -> Seq.seq(t.v2))
        );
    }
525861
def absorb_args(self, func):
        
        @wraps(func)
        def wrapper(*args, **kwargs):
            return func()
        return wrapper
440739
def _iterable_to_varargs_method(func):
    """"""
    def wrapped(self, *args, **kwargs):
        return func(self, args, **kwargs)
    return wrapped
456974
public <R> MultiEnvAware<R> convert(BiFunction<String, T, R> func) {
        return convert(func, null);
    }
390709
def then_by(self, func):
        
        if func is None:
            raise NullArgumentError(u"then by requires a lambda function arg")
        self._key_funcs.append(OrderingDirection(key=func, reverse=False))
        return SortedEnumerable(self._key_funcs, self._data)
747241
def flatMap(f: Callable, xs: Iterable) -> List:
    
    return flatten(lmap(f, xs))
527485
def flatten(l: Iterable) -> List:
    
    rval = []
    for e in l:
        if not isinstance(e, str) and isinstance(e, Iterable):
            if len(list(e)):
                rval += flatten(e)
        else:
            rval.append(e)
    return rval
1346547
def wrap(self, func):
        
        @six.wraps(func)
        def wrapper(*args, **kwargs):
            try:
                return self.aggregate()
            except KeyError:
                return func(*args, **kwargs)
        return wrapper
794572
def map(self, func, value_shape=None, dtype=None):
        
        mapped = self.values.map(func, value_shape=value_shape, dtype=dtype)
        return self._constructor(mapped).__finalize__(self, noprop=('dtype',))
403219
def map(cls, iterable, func, *a, **kw):
    

    return cls(func(x, *a, **kw) for x in iterable)
1073382
def map(self, f, preservesPartitioning=False):
        
        def func(iterator):
            return map(f, iterator)
        return self.mapPartitions(func, preservesPartitioning)
1366117
def reduce(self, func):
        

        # avoid RDD.reduce() which does not return an RDD
        return self.transform(
            lambda rdd: (
                rdd
                .map(lambda i: (None, i))
                .reduceByKey(func)
                .map(lambda none_i: none_i[1])
            )
        )
262929
def _batch_request(self, func, iterable):
        
        responses = []
        for item in iterable:
            responses.append(func(item))
            time.sleep(self.API_LIMIT)
        return responses
417245
def wrmap(func, iterable, *args):
    ''
    for it in iterable:
        try:
            yield func(it, *args)
        except Exception as e:
            pass