creates a new generator that passes the result of this generator
to the callable $k which should return a new generator.

@param callable $k
@return Generator
194033
public function bind(callable $k)
    {
        return $this->bindGen(
            function (RoseTree $rose) use ($k) {
                $gen = new self(function ($rng, $size) use ($rose, $k) {
                    return $rose->fmap($k)
                        ->fmap(FP::method('call', $rng, $size));
                });
                return $gen->fmapGen(FP::method('join'));
            }
        );
    }
513721
public static function getGeneratorMap() {
        $generatorMap = array();
        foreach (self::getGenerators() as $generator)
            $generatorMap[call_user_func(array($generator, "getKey"))] = $generator;
        return $generatorMap;
    }
54528
public function getGenerator()
    {
        if (!$this->generator) {
            $this->generator = Factory::create($this->locale);
        }

        return $this->generator;
    }
137759
public function &__get($k)
    {
        if (!isset($this->realConn->{$k})) {
            return $dummy;
        }
        return $this->realConn->{$k};
    }
522153
public function values(): self
    {
        return static::create(
            function () {
                /** @noinspection YieldFromCanBeUsedInspection */
                foreach ($this->getGenerator() as $value) {
                    yield $value;
                }
            },
            $this->iteratorClass,
            false
        );
    }
1195305
public static function set($k,$v=null) {
        if(is_array($k)) {
            return self::$o->config = array_merge(self::$o->config,$k);
        }
        return self::$o->config[$k]=$v;
    }
368670
public GeneratorSetBuilder generator( String functionName, ITestCaseGenerator generator)
    {
    generatorSet_.addGenerator( functionName, generator);
    return this;
    }
855093
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new CodeGeneratorRequest();
			case 1:
				return new CodeGeneratorRequest(func_get_arg(0));
			case 2:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1));
			case 3:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new CodeGeneratorRequest(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
1020262
private function execute(): \Generator
    {
        $job = yield $this->channel->receive();

        while ($job instanceof Internal\Job) {
            try {
                $result = yield call([$job->getTask(), "run"], $this->environment);
                $result = new Internal\TaskSuccess($job->getId(), $result);
            } catch (\Throwable $exception) {
                $result = new Internal\TaskFailure($job->getId(), $exception);
            }

            $job = null; // Free memory from last job.

            try {
                yield $this->channel->send($result);
            } catch (SerializationException $exception) {
                // Could not serialize task result.
                yield $this->channel->send(new Internal\TaskFailure($result->getId(), $exception));
            }

            $result = null; // Free memory from last result.

            $job = yield $this->channel->receive();
        }

        return $job;
    }
618297
function get($k = null) {return dfak($this, function() {
		$c = $this[self::$P__ITEM_CLASS]; /** @var string $c */
		return df_index(
			function(ArrayItem $o) {return $o->id();}
			,array_map(function($data) use($c) {return new $c($data);}, $this->a())
		);
	}, $k);}
590072
public static <S> PAreaBIGenerator<S> create()
  {
    return new PAreaBIGenerator<>(new Generator<BigInteger>()
    {
      private final Random random = new Random();

      @Override
      public BigInteger next()
      {
        return BigInteger.valueOf(Math.abs(this.random.nextLong()));
      }
    });
  }
393678
private function processGeneratorContainerRunning(GeneratorContainer $gc)
    {
        // Check delay request yields
        if ($gc->key() === CoInterface::DELAY) {
            return $this->pool->addDelay($gc->current())
            ->then(function () use ($gc) {
                $gc->send(null);
                return $this->processGeneratorContainer($gc);
            });
        }

        // Now we normalize yielded value
        $yielded = YieldableUtils::normalize($gc->current());
        $yieldables = YieldableUtils::getYieldables($yielded, [], $this->runners);
        if (!$yieldables) {
            // If there are no yieldables, send yielded value back into generator
            $gc->send($yielded);
            // Continue
            return $this->processGeneratorContainer($gc);
        }

        // Chain resolver
        return $this->promiseAll($yieldables, $gc->key() !== CoInterface::SAFE)
        ->then(
            YieldableUtils::getApplier($yielded, $yieldables, [$gc, 'send']),
            [$gc, 'throw_']
        )->then(function () use ($gc, $yieldables) {
            // Continue
            $this->runners = array_diff_key($this->runners, $yieldables);
            return $this->processGeneratorContainer($gc);
        });
    }
343925
public function call(string $method, $args): \Generator
    {
        $request = new Request();
        $request->id = $this->idSequence->current();
        $this->idSequence->next();
        $request->method = $method;
        $request->params = $args;

        $serializedRequest = Json::encode($this->mapper->dump($request));
        $this->pendingRequests[$request->id] = yield Recoil::strand();
        yield Recoil::execute($this->transport->send($serializedRequest));

        /** @var ResultResponse|ErrorResponse $response */
        $response = yield Recoil::suspend();

        if ($response instanceof ErrorResponse) {
            throw $response->error;
        }

        return $response->result;
    }
147566
public function yield(): Generator
	{
		foreach($this->fetchYield(PDO::FETCH_ASSOC) as $row)
		{
			yield $this->hydrateModel($row);
		}
	}
357996
def new(cls) -> 'Generator':
        
        logger = logging.getLogger(__name__)
        logger.debug("Generator::new: >>>")

        c_instance = c_void_p()
        do_call(cls.new_handler, byref(c_instance))

        res = cls(c_instance)

        logger.debug("Generator::new: <<< res: %r", res)
        return res
1200482
public function setDefault($k, $v = null)
    {
        if (!is_array($k)) {
            $k = [$k => $v];
        }

        foreach ($k as $kk => $vv) {
            if ($this->offsetExists($kk)) {
                continue;
            }

            $this->offsetSet($kk, $vv);
        }

        return $this;
    }
190975
public function generate(&$result,GeneratorInterface $generator)
    {
        if($this->literals->count() === 0) {
            throw new GeneratorException('There are no literals to choose from');
        }
        
       $repeat_x = $this->calculateRepeatQuota($generator);
        
        while($repeat_x > 0) {
             $randomIndex = 0;
             
             if($this->literals->count() > 1) {
                $randomIndex = \round($generator->generate(1,($this->literals->count())));        
             }
             
             $result     .= $this->literals->getAt($randomIndex);
             
             --$repeat_x;
        }
        
        return $result;
        
    }