Generator function used to iterate over each complete,
    top-level type contained in in a signature. Ex::
      "iii"       => [ 'i', 'i',       'i' ]
      "i(ii)i"    => [ 'i', '(ii)',    'i' ]
      "i(i(ii))i" => [ 'i', '(i(ii))', 'i' ]
489243
def genCompleteTypes( compoundSig ):
    

    i     = 0
    start = 0
    end   = len(compoundSig)

    def find_end( idx, b, e ):
        depth = 1
        while idx < end:
            subc = compoundSig[idx]
            if subc == b:
                depth += 1
            elif subc == e:
                depth -= 1
                if depth == 0:
                    return idx
            idx += 1
    
    while i < end:
        c = compoundSig[i]
        
        if c == '(':
            x = find_end(i+1, '(', ')')
            yield compoundSig[i:x+1]
            i = x

        elif c == '{':
            x = find_end(i+1, '{', '}')
            yield compoundSig[i:x+1]
            i = x

        elif c == 'a':
            start = i
            g = genCompleteTypes( compoundSig[i+1:] )
            ct = six.next(g)
            i += len(ct)
            yield 'a' + ct
            
        else:
            yield c
        i += 1
800998
def _iter(self, with_final=True):
        
        # MUST have called fit first
        stop = len(self.steps_)
        if not with_final:
            stop -= 1

        for idx, (name, trans) in enumerate(islice(self.steps_, 0, stop)):
            yield idx, name, trans
372960
def itertypes(iterable):
    """"""
    seen = set()
    for entry in iterable:
        if isinstance(entry, tuple):
            for type_ in entry:
                if type_ not in seen:
                    seen.add(type_)
                    yield type_
        else:
            if entry not in seen:
                seen.add(entry)
                yield entry
601721
def _yield_all(self, l):
        '''
        
        '''
        if l is not None:
            if type(l) in [list, tuple]:
                for f in l:
                    for x in self._yield(f): yield x
            else:
                for x in self._yield(l): yield x
193176
function makeIter(iterable) {
    if (typeof iterable[iterSymbol] === 'function') {
        // passed argument can create iterators - create new one.
        return iterable[iterSymbol]();
    }

    if (!_isSubscriptable(iterable)) {
        throw Error('Unsupported argument type');
    }

    // passed argument can be indexed, eg. string, array, etc.
    // - create new iter object.
    var idx = -1;
    return {
        next: function() {
            return ++idx < iterable.length
                ? {done: false, value: iterable[idx]}
                : {done: true};
        }
    };
}
112176
def iapply(function, *iterables):
    

    iterables = map(iter, iterables)
    while True:
        args = [next(it) for it in iterables]
        if function is None:
            yield tuple(args)
        else:
            function(*args)
            yield args[0]
106435
def palindromic_substrings_iter(s):
    
    if not s:
        yield []
        return
    for i in range(len(s), 0, -1):
        sub = s[:i]
        if sub == sub[::-1]:
            for rest in palindromic_substrings_iter(s[i:]):
                yield [sub] + rest
949434
def iterate_symbols():
    
    for prefix in search_prefixes():
        package = importlib.import_module(prefix)
        for importer, modname, ispkg in pkgutil.walk_packages(path=package.__path__, onerror=lambda x: None):
            network = network_for_netcode(modname)
            if network:
                yield network.symbol.upper()
827858
def visit_ListComp(self, node):
        
        try:
            generator, = node.generators
        except ValueError:
            raise NotImplementedError(
                'Only single loop comprehensions are allowed'
            )

        names = find_names(generator.target)
        argslist = [ast.arg(arg=name.id, annotation=None) for name in names]
        if len(names) <= 1:
            signature = ast.arguments(
                args=argslist,
                vararg=None,
                kwonlyargs=[],
                kw_defaults=[],
                kwarg=None,
                defaults=[],
            )
        else:
            signature = ast.List(elts=argslist, ctx=ast.Load())

        array = generator.iter
        lam_sig = functools.partial(ast.Lambda, args=signature)

        filters = generator.ifs
        if filters:
            filt = ast.BoolOp(op=ast.And(), values=filters)
            # array.filter
            method = ast.Attribute(value=array, attr='filter', ctx=ast.Load())
            # array.filter(func)
            array = ast.Call(
                func=method, args=[lam_sig(body=filt)], keywords=[]
            )

        method = ast.Attribute(value=array, attr='map', ctx=ast.Load())
        mapped = ast.Call(
            func=method, args=[lam_sig(body=node.elt)], keywords=[]
        )
        result = self.visit(mapped)
        return result
1075312
def iter_methods(self):
        
        for wrkey, obj in self.iter_instances():
            f, obj_id = wrkey
            if f == 'function':
                yield self[wrkey]
            else:
                yield getattr(obj, f.__name__)
279267
function parseArgs(signature) {
  var args = [];
  var count = {};
  var index = {};
  var length = signature.length;
  for (var i = 0; i < length; i++) {
    var arg = signature[i];
    if (count[arg]) {
      count[arg]++;
    } else {
      count[arg] = 1;
    }
    index[arg] = 0;
  }
  for (var i = 0; i < length; i++) {
    var arg = signature[i];
    if (count[arg] > 1) {
      args.push(arg + "" + index[arg]);
      index[arg]++;
    } else {
      args.push(arg);
    }
  }
  return args
}
1068113
def itervisit(
            self, iterable, gentype=types.GeneratorType,
            exhaust_generators=True):
        '''
        '''
        self.iterable = iter(iterable)
        for token in self.iterable:
            result = self.itervisit_node(token)
            if exhaust_generators and isinstance(result, gentype):
                for output in result:
                    yield output
            elif result is not None:
                yield result
        result = self.finalize()
        if result is self:
            return
        if isinstance(result, gentype):
            for output in result:
                yield output
220932
def listify(generator_func):
    '''
    
    '''
    def list_func(*args, **kwargs):
        return degenerate(generator_func(*args, **kwargs))
    return list_func
954601
def coll_to_tuples(cls, coll):
        
        if isinstance(coll, basestring):
            raise exc.CollectionCoerceError(
                passed=coll,
                colltype=cls,
            )
        if isinstance(coll, collections.Mapping):
            i = 0
            for k in sorted(coll.keys()):
                yield (i, coll[k])
        elif isinstance(coll, (collections.Sequence, types.GeneratorType)) or (
            hasattr(coll, "next") and callable(coll.next)
        ) or (
            hasattr(coll, "__iter__") and callable(coll.__iter__)
        ):
            i = 0
            for v in coll:
                yield i, v
                i += 1
        elif not coll:
            return
        else:
            raise exc.CollectionCoerceError(
                passed=coll,
                colltype=cls,
            )
1199343
def gen_list_name():
    
    for name in _LIST_NAMES:
        yield name

    counter = itertools.count(1000)
    while True:
        yield b(str(next(counter))) + b"\x00"
304860
def _combined_wildcards_iter(flatterm: Iterator[TermAtom]) -> Iterator[TermAtom]:
        """"""
        last_wildcard = None  # type: Optional[Wildcard]
        for term in flatterm:
            if isinstance(term, Wildcard) and not isinstance(term, SymbolWildcard):
                if last_wildcard is not None:
                    new_min_count = last_wildcard.min_count + term.min_count
                    new_fixed_size = last_wildcard.fixed_size and term.fixed_size
                    last_wildcard = Wildcard(new_min_count, new_fixed_size)
                else:
                    last_wildcard = Wildcard(term.min_count, term.fixed_size)
            else:
                if last_wildcard is not None:
                    yield last_wildcard
                    last_wildcard = None
                yield term
        if last_wildcard is not None:
            yield last_wildcard
1348246
def generators():
    
    from populous import generators

    base = generators.Generator

    for name in dir(generators):
        generator = getattr(generators, name)

        if isinstance(generator, type) and issubclass(generator, base):
            name = generator.__name__
            doc = (generator.__doc__ or '').strip()

            if doc:
                click.echo("{} - {}".format(name, doc))
            else:
                click.echo(name)