Return the generator function.
775158
def generator(self, t):
        """"""
        self.check_fit()

        return (1.0 / self.theta) * (np.power(t, -self.theta) - 1)
302884
public Iterator
generators() {
	if (generators != null)
		return Collections.unmodifiableList(generators).iterator();
	else
		return Collections.EMPTY_LIST.iterator();
}
1333177
def cycle_generator(cycle, step=1, begin=(0, 0), end=None):
    '''
        
    '''
    (cycle_begin, cycle_end) = cycle
    (major, minor) = begin
    (end_major, end_minor) = end if end is not None else (None, None)

    while True:
        if end is not None and (major > end_major or (major == end_major and minor > end_minor)):
            return
        yield (major, minor)
        minor += step
        if minor > cycle_end:
            major += 1
            minor = cycle_begin
845787
public function getIterator(): \Generator
    {
        foreach ($this->data as $index => $data) {
            if (isset($data[ORMInterface::PIVOT_DATA])) {
                /*
                 * When pivot data is provided we are able to use it as array key.
                 */
                $index = $data[ORMInterface::PIVOT_DATA];
                unset($data[ORMInterface::PIVOT_DATA]);
            }

            yield $index => $this->orm->make(
                $this->class,
                $data,
                ORMInterface::STATE_LOADED,
                true
            );
        }
    }
237583
def generate_from_args(self, *args):
        
        return self.generate(**dict(zip(self.variable_args, args)))
8445
def get(self, name=None):
        """"""
        if name is None:
            return self.init_value
        elif not self.support_name:
            msg = "generator does not support get-by-name: function {!r}"
            raise TypeError(msg.format(self.function))
        try:
            value = self.generator.send(name)
        except StopIteration:
            msg = "generator didn't yield: function {!r}"
            raise RuntimeError(msg.format(self.function))
        return value
186586
def find_generator_as_statement(node):
    """"""
    return (
        isinstance(node, ast.Expr)
        and isinstance(node.value, ast.GeneratorExp)
    )
104263
def all_generators(self):
        
        for arg_gen in self.arg_gens:
            yield arg_gen

        for kwarg_gen in self.kwarg_gens.values():
            yield kwarg_gen
300434
def get_current_generator(self):
        """"""
        int_index=int(len(self.generators)*wrap(0,1.0,self.inspect_value('index')))
        return self.generators[int_index]
839336
def parse(self, generator):
        """"""
        gen = iter(generator)
        for line in gen:
            block = {}
            for rule in self.rules:
                if rule[0](line):
                    block = rule[1](line, gen)
                    break
            yield block
463307
def peekiter(iterable):
    """"""
    it = iter(iterable)
    one = next(it)

    def gen():
        """Generator that returns first and proxy other items from source"""
        yield one
        while True:
            yield next(it)
    return (one, gen())
150944
def make_input_fn_from_generator(gen):
  """"""
  first_ex = six.next(gen)
  flattened = tf.contrib.framework.nest.flatten(first_ex)
  types = [t.dtype for t in flattened]
  shapes = [[None] * len(t.shape) for t in flattened]
  first_ex_list = [first_ex]

  def py_func():
    if first_ex_list:
      example = first_ex_list.pop()
    else:
      example = six.next(gen)
    return tf.contrib.framework.nest.flatten(example)

  def input_fn():
    flat_example = tf.py_func(py_func, [], types)
    _ = [t.set_shape(shape) for t, shape in zip(flat_example, shapes)]
    example = tf.contrib.framework.nest.pack_sequence_as(first_ex, flat_example)
    return example

  return input_fn
951795
def functions(self):
        """"""
        deffunction = lib.EnvGetNextDeffunction(self._env, ffi.NULL)

        while deffunction != ffi.NULL:
            yield Function(self._env, deffunction)

            deffunction = lib.EnvGetNextDeffunction(self._env, deffunction)
1373422
def set_of(*generators):
    

    class SetOfGenerators(ArbitraryInterface):
        """
        A closure class around the generators specified above, which
        generates a set of the generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate a set of the enclosed generators.
            """
            arbitrary_set = set()
            for generator in generators:
                arbitrary_set |= {
                    arbitrary(generator)
                    # max_size / len(generators):
                    for _ in range(arbitrary(int) % 100)
                }
            return arbitrary_set

    SetOfGenerators.__name__ = ''.join([
        'set_of(', ', '.join(generator.__name__ for generator in generators),
        ')'
    ])
    return SetOfGenerators
737050
def generate(fn):
    ''''''
    if isinstance(fn, str):
        return lambda f: generate(f).desc(fn)

    @wraps(fn)
    @Parser
    def generated(text, index):
        iterator, value = fn(), None
        try:
            while True:
                parser = iterator.send(value)
                res = parser(text, index)
                if not res.status:  # this parser failed.
                    return res
                value, index = res.value, res.index  # iterate
        except StopIteration as stop:
            endval = stop.value
            if isinstance(endval, Parser):
                return endval(text, index)
            else:
                return Value.success(index, endval)
    return generated.desc(fn.__name__)
824609
def is_generator(self, node):
        """"""
        results = {}
        if self.yield_expr.match(node, results):
            return True
        for child in node.children:
            if child.type not in (syms.funcdef, syms.classdef):
                if self.is_generator(child):
                    return True
        return False
676305
public function getIterator() : \Generator
    {
        for ($current = $this->startDate; $current->isBeforeOrEqualTo($this->endDate); $current = $current->plusDays(1)) {
            yield $current;
        }
    }