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

Method __call__

functional/streams.py:289–309  ·  view source on GitHub ↗

Create a Sequence using a parallel ExecutionEngine. If args has more than one argument then the argument list becomes the sequence. If args[0] is primitive, a sequence wrapping it is created. If args[0] is a list, tuple, iterable, or Sequence it is wrapped as a Se

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

287 self.partition_size = partition_size
288
289 def __call__(self, *args, **kwargs):
290 """
291 Create a Sequence using a parallel ExecutionEngine.
292
293 If args has more than one argument then the argument list becomes the sequence.
294
295 If args[0] is primitive, a sequence wrapping it is created.
296
297 If args[0] is a list, tuple, iterable, or Sequence it is wrapped as a Sequence.
298
299 :param args: Sequence to wrap
300 :return: Wrapped sequence
301 """
302 processes = kwargs.get("processes") or self.processes
303 partition_size = kwargs.get("partition_size") or self.partition_size
304 engine = ParallelExecutionEngine(
305 processes=processes, partition_size=partition_size
306 )
307 return self._parse_args(
308 args, engine, "pseq() takes at least 1 argument ({0} given)"
309 )
310
311
312# pylint: disable=invalid-name

Callers

nothing calls this directly

Calls 2

_parse_argsMethod · 0.80

Tested by

no test coverage detected