Define a delimited list by enumerating each element of the list.
187932
def nest(*content):
    """"""
    if len(content) == 0:
        raise ValueError('no arguments supplied')
    return And([LPF, content[0]] + list(itt.chain.from_iterable(zip(itt.repeat(C), content[1:]))) + [RPF])
241517
def split_every(n, iterable):
    """"""
    items = iter(iterable)
    return itertools.takewhile(bool, (list(itertools.islice(items, n)) for _ in itertools.count()))
147559
public static Array listToArrayTrim(String list, char delimiter) {
	if (list.length() == 0) return new ArrayImpl();
	// remove at start
	while (list.indexOf(delimiter) == 0) {
	    list = list.substring(1);
	}
	int len = list.length();
	if (len == 0) return new ArrayImpl();
	while (list.lastIndexOf(delimiter) == len - 1) {
	    list = list.substring(0, len - 1 < 0 ? 0 : len - 1);
	    len = list.length();
	}
	return listToArray(list, delimiter);
    }
1228266
function(list, delim) {
            return new Anonymous(!isArray(list.value)
                ? list.toCSS()
                : list.value.map(function(a) {
                    return toString(a, "", "");
                }).join(delim ? delim.value : ", "));
        }
414046
def list2string (inlist,delimit=' '):
    
    stringlist = [makestr(_) for _ in inlist]
    return string.join(stringlist,delimit)
229215
public static Array listToArray(String list, char delimiter) {
	if (list.length() == 0) return new ArrayImpl();
	int len = list.length();
	int last = 0;

	Array array = new ArrayImpl();
	try {
	    for (int i = 0; i < len; i++) {
		if (list.charAt(i) == delimiter) {
		    array.append(list.substring(last, i));
		    last = i + 1;
		}
	    }
	    if (last <= len) array.append(list.substring(last));
	}
	catch (PageException e) {}
	return array;
    }
906200
def delimited(nodes, delimiter = ', ')
      max = nodes.length - 1
      nodes.each_with_index do |element, index|
        element.visit(self)
        append(delimiter) if index < max
      end
      self
    end
50625
def n_list(self, node):
        
        p = self.prec
        self.prec = 100
        n = node.pop()
        lastnode = n.kind
        start = len(self.f.getvalue())
        if lastnode.startswith('BUILD_LIST'):
            self.write('['); endchar = ']'
        elif lastnode.startswith('BUILD_TUPLE'):
            self.write('('); endchar = ')'
        elif lastnode.startswith('BUILD_SET'):
            self.write('{'); endchar = '}'
        elif lastnode.startswith('ROT_TWO'):
            self.write('('); endchar = ')'
        else:
            raise RuntimeError('Internal Error: n_list expects list or tuple')

        flat_elems = []
        for elem in node:
            if elem == 'expr1024':
                for subelem in elem:
                        for subsubelem in subelem:
                            flat_elems.append(subsubelem)
            elif elem == 'expr32':
                for subelem in elem:
                    flat_elems.append(subelem)
            else:
                flat_elems.append(elem)

        self.indent_more(INDENT_PER_LEVEL)
        if len(node) > 3:
            line_separator = ',\n' + self.indent
        else:
            line_separator = ', '
        sep = INDENT_PER_LEVEL[:-1]

        # FIXME:
        # if flat_elems > some_number, then group
        # do automatic wrapping
        for elem in flat_elems:
            if (elem == 'ROT_THREE'):
                continue

            assert elem == 'expr'
            value = self.traverse(elem)
            self.node_append(sep, value, elem)
            sep = line_separator
        if len(node) == 1 and lastnode.startswith('BUILD_TUPLE'):
            self.write(',')
        self.write(endchar)
        finish = len(self.f.getvalue())
        n.parent = node.parent
        self.set_pos_info(n, start, finish)
        self.set_pos_info(node, start, finish)
        self.indent_less(INDENT_PER_LEVEL)
        self.prec = p
        self.prune()
        return
1028450
def flat_list(input_list):
    

    """
    x = input_list
    if isinstance(x, list):
        return [a for i in x for a in flat_list(i)]
    else:
        return [x]
552819
def p_enum_list(self, p):
        ''''''
        if p[1] is None:
            p[0] = []
        elif len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]
74139
def build_list(self):
        """"""
        ret = []
        for p in self.args.stdout.split(','):
            if '.' in p:
                p, a = p.split('.')
            else:
                a = None
            ret.append((p, a))
        return ret
866910
def process_lists(self):
        """"""
        for l1_idx, obj1 in enumerate(self.l1):
            for l2_idx, obj2 in enumerate(self.l2):
                if self.equal(obj1, obj2):
                    self.matches.add((l1_idx, l2_idx))
1052850
def __begin_of_list(self, ast_token):
        """"""
        self.list_level += 1
        if self.list_level == 1:
            self.final_ast_tokens.append(ast_token)
1373488
def _compile_list(self, data, indent_level):
        """"""
        if len(data) == 0:
            return '--'
        elif not any(isinstance(i, (dict, list)) for i in data):
            return ', '.join(self._compile_literal(value) for value in data)
        else:
            # 'ere be dragons,
            # granted there are fewer dragons than the parser,
            # but dragons nonetheless
            buffer = ''
            i = 0
            while i < len(data):
                if isinstance(data[i], dict):
                    buffer += '\n'
                    buffer += self._indent * indent_level
                    while i < len(data) and isinstance(data[i], dict):
                        buffer += '-\n'
                        buffer += self._compile_key_val(data[i], indent_level)
                        buffer += self._indent * indent_level + '-'
                        i += 1
                    buffer += '\n'
                elif (
                    isinstance(data[i], list) and
                    any(isinstance(item, (dict, list)) for item in data[i])
                ):
                    buffer += self._compile_list(data[i], indent_level+1)
                elif isinstance(data[i], list):
                    buffer += '\n'
                    buffer += self._indent * indent_level
                    buffer += self._compile_list(data[i], indent_level+1)
                else:
                    buffer += '\n'
                    buffer += self._indent * indent_level
                    buffer += self._compile_literal(data[i])

                i += 1

            return buffer
872539
def _sublist(items, starting_value, ending_value=None):
        
        have_started = starting_value is None

        for x in items:
            have_started = have_started or x == starting_value
            if have_started:
                yield x

            if ending_value is not None and x == ending_value:
                break
1341148
def data(value):
        
        for i, entry in enumerate(value):
            _assert_is_type('data[{0}]'.format(i), entry,  Data)
217336
private Set<String> toSet(String value, String delimiter) {
        if (Strings.isNullOrEmpty(value)) {
            return Collections.emptySet();
        } else {
            Set<String> stringSet = new LinkedHashSet<>();
            String[] values = value.split(delimiter);
            for (String stringValue : values) {
                if (!Strings.isNullOrEmpty(stringValue)) {
                    stringSet.add(stringValue.trim());
                }
            }

            return stringSet;
        }
    }