MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / cartesian

Method cartesian

functional/pipeline.py:353–369  ·  view source on GitHub ↗

Returns the cartesian product of the passed iterables with the specified number of repetitions. The keyword argument `repeat` is read from kwargs to pass to itertools.cartesian. >>> seq.range(2).cartesian(range(2)) [(0, 0), (0, 1), (1, 0), (1, 1)]

(self, *iterables, **kwargs)

Source from the content-addressed store, hash-verified

351 return self._transform(transformations.tails_t(_wrap))
352
353 def cartesian(self, *iterables, **kwargs):
354 """
355 Returns the cartesian product of the passed iterables with the specified number of
356 repetitions.
357
358 The keyword argument `repeat` is read from kwargs to pass to itertools.cartesian.
359
360 >>> seq.range(2).cartesian(range(2))
361 [(0, 0), (0, 1), (1, 0), (1, 1)]
362
363 :param iterables: elements for cartesian product
364 :param kwargs: the variable `repeat` is read from kwargs
365 :return: cartesian product
366 """
367 return self._transform(
368 transformations.cartesian_t(iterables, kwargs.get("repeat", 1))
369 )
370
371 def drop(self, n):
372 """

Callers 1

test_cartesianMethod · 0.80

Calls 1

_transformMethod · 0.95

Tested by 1

test_cartesianMethod · 0.64