generator on all declaration of type
976780
def declalltypes(self):
        """"""
        for f in self.body:
            if (hasattr(f, '_ctype')
                    and f._ctype._storage == Storages.TYPEDEF):
                yield f
734116
public static void writeGenerators( IGeneratorSet generators, OutputStream outputStream)
    {
    try( GeneratorSetJsonWriter writer = new GeneratorSetJsonWriter( outputStream))
      {
      writer.write( generators);
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't write generator definitions", e);
      }
    }
696002
function generateProp(type, defaultVal) {
        if ( type === void 0 ) type = [Boolean, String, Number];
        if ( defaultVal === void 0 ) defaultVal = null;

        return {
            default: defaultVal,
            type: type
        }
    }
1094453
function genTypePartial(gen, field, fieldIndex, ref) {
  return field.resolvedType.group ?
    gen('types[%i].encode(%s,w.uint32(%i)).uint32(%i)', fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0) :
    gen('types[%i].encode(%s,w.uint32(%i).fork()).ldelim()', fieldIndex, ref, (field.id << 3 | 2) >>> 0);
}
945820
def declallfuncs(self):
        """"""
        for f in self.body:
            if (hasattr(f, '_ctype')
                    and isinstance(f._ctype, FuncType)):
                yield f
752328
@CheckReturnValue
    public <K> FluentGenerator<K> ofType(@Nonnull Class<K> type) {
        return from(Generators.ofType(checkNotNull(type), delegate));
    }
186586
def find_generator_as_statement(node):
    """"""
    return (
        isinstance(node, ast.Expr)
        and isinstance(node.value, ast.GeneratorExp)
    )
1032192
def get_generator_type(genr):
    
    if genr in _checked_generator_types:
        return _checked_generator_types[genr]
    if not genr.gi_frame is None and 'gen_type' in genr.gi_frame.f_locals:
        return genr.gi_frame.f_locals['gen_type']
    else:
        cllble, nesting, slf = util.get_callable_fq_for_code(genr.gi_code)
        if cllble is None:
            return Generator
        return _funcsigtypes(cllble, slf, nesting[-1] if slf else None,
                genr.gi_frame.f_globals if not genr.gi_frame is None else None)[1]
534955
def _string_generator(descriptor, max_length=0, limit=0):
    ''
    vals = list(values.get_strings(max_length, limit))
    return gen.IterValueGenerator(descriptor.name, vals)
791057
def try_one_generator_really (project, name, generator, target_type, properties, sources):
    
    if __debug__:
        from .targets import ProjectTarget
        assert isinstance(project, ProjectTarget)
        assert isinstance(name, basestring) or name is None
        assert isinstance(generator, Generator)
        assert isinstance(target_type, basestring)
        assert isinstance(properties, property_set.PropertySet)
        assert is_iterable_typed(sources, virtual_target.VirtualTarget)
    targets = generator.run (project, name, properties, sources)

    usage_requirements = []
    success = False

    dout("returned " + str(targets))

    if targets:
        success = True;

        if isinstance (targets[0], property_set.PropertySet):
            usage_requirements = targets [0]
            targets = targets [1]

        else:
            usage_requirements = property_set.empty ()

    dout(  "  generator" + generator.id() + " spawned ")
    #    generators.dout [ indent ] " " $(targets) ;
#    if $(usage-requirements)
#    {
#        generators.dout [ indent ] "  with usage requirements:" $(x) ;
#    }

    if success:
        return (usage_requirements, targets)
    else:
        return None
314017
def deftypes(self):
    """"""
    for f in self.body:
        if (hasattr(f, '_ctype')
                and (f._ctype._storage == Storages.TYPEDEF
                    or (f._name == '' and isinstance(f._ctype, ComposedType)))):
            yield f
209898
def generator(self,gen,*args,**kwargs):
        
        with self(*args,**kwargs):
            for i in gen:
                yield i
272772
def is_generator(self, node):
        """"""
        if not isinstance(node.body, list):
            # lambdas can not be generators
            return False
        for item in node.body:
            if isinstance(item, (ast.Assign, ast.Expr)):
                if isinstance(item.value, ast.Yield):
                    return True
            elif not isinstance(item, ast.FunctionDef) and hasattr(item, 'body'):
                if self.is_generator(item):
                    return True
        return False
1341595
def one_of(*generators):
    

    class OneOfGenerators(ArbitraryInterface):
        """
        A closure class around the generators specified above, which
        generates one of the generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate one of the enclosed generators.
            """
            return arbitrary(random.choice(generators))

    OneOfGenerators.__name__ = ''.join([
        'one_of(', ', '.join(generator.__name__ for generator in generators),
        ')'
    ])
    return OneOfGenerators
381059
@SuppressWarnings( "UnusedDeclaration" )
    public void addGenerator( ObjectIdGenerator<?> generator ) {
        if ( null == generators ) {
            generators = new ArrayList<ObjectIdGenerator<?>>();
        }
        generators.add( generator );
    }
432935
def _compile_pfgen(self):
        """"""
        string = '"""\n'
        string += 'system.dae.init_g()\n'
        for gcall, pflow, shunt, series, stagen, call in zip(
                self.gcall, self.pflow, self.shunt, self.series, self.stagen,
                self.gcalls):
            if gcall and pflow and (shunt or series) and not stagen:
                string += call
        string += '\n'
        string += 'system.dae.reset_small_g()\n'
        string += '"""'
        self.pfgen = compile(eval(string), '', 'exec')
1040454
def each(io)
      if block_given?
        filter = BELParser::ASTFilter.new(
          BELParser::ASTGenerator.new(io),
          *TYPES)
        filter.each do |results|
          yield results
        end
      else
        enum_for(:each, io)
      end
    end