We are in a list so get values until the end token.  This can also
        used to get tuples.
332214
def make_list(self, end_token="]"):
        
        out = []
        while True:
            try:
                value = self.value_assign(end_token=end_token)
                out.append(value)
                self.separator(end_token=end_token)
            except self.ParseEnd:
                return out
673088
def _parse_values(values, extra=None):
    
    coerced = list(values)

    if coerced == values:
        values = coerced
    else:
        coerced = tuple(values)
        if coerced == values:
            values = list(values)
        else:
            values = [values]

    if extra:
        values.extend(extra)
    return values
444686
def get_tokens(line: str) -> Iterator[str]:
    
    for token in line.rstrip().split():
        if len(token) > 0:
            yield token
1150459
def _to_tuple(self, _list):
        
        result = list()
        for l in _list:
            if isinstance(l, list):
                result.append(tuple(self._to_tuple(l)))
            else:
                result.append(l)
        return tuple(result)
1318416
def _read_until(infile=sys.stdin, maxchars=20, end=RS):
    '''   '''
    chars = []
    read = infile.read
    if not isinstance(end, tuple):
        end = (end,)

    # count down, stopping at 0
    while maxchars:
        char = read(1)
        if char in end:
            break
        chars.append(char)
        maxchars -= 1

    return ''.join(chars)
432106
def getcoordinates(self, tree, location):
        """"""
        return tuple(float(x) for x in tree.xpath('.//%s/*/text()' % location))
758871
def value_assign(self, end_token=None):
        
        while True:
            token = self.next()
            t_value = token["value"]
            if end_token:
                if t_value == end_token:
                    raise self.ParseEnd()
                elif t_value == "\n":
                    continue
            if token["type"] == "literal":
                return self.make_value(t_value)
            if token["type"] == "function":
                return self.config_function(token)
            elif t_value == "[":
                return self.make_list()
            elif t_value == "{":
                return self.make_dict()
            elif t_value == "(":
                return tuple(self.make_list(end_token=")"))
            else:
                self.error("Value expected", previous=not (end_token))
223560
public static <T> T getLast(List<T> list) {
		if (isEmpty(list)) {
			return null;
		}

		return list.get(list.size() - 1);
	}
1324428
private static List<Object> readList(StreamingInput input)
		throws IOException
	{
		input.next(Token.LIST_START);

		List<Object> result = new ArrayList<Object>();
		while(input.peek() != Token.LIST_END)
		{
			// Read the value
			Object value = readDynamic(input);
			result.add(value);
		}

		input.next(Token.LIST_END);

		return result;
	}
324856
def get_tokens(tu, extent):
        
        tokens_memory = POINTER(Token)()
        tokens_count = c_uint()

        conf.lib.clang_tokenize(tu, extent, byref(tokens_memory),
                byref(tokens_count))

        count = int(tokens_count.value)

        # If we get no tokens, no memory was allocated. Be sure not to return
        # anything and potentially call a destructor on nothing.
        if count < 1:
            return

        tokens_array = cast(tokens_memory, POINTER(Token * count)).contents

        token_group = TokenGroup(tu, tokens_memory, tokens_count)

        for i in xrange(0, count):
            token = Token()
            token.int_data = tokens_array[i].int_data
            token.ptr_data = tokens_array[i].ptr_data
            token._tu = tu
            token._group = token_group

            yield token
1314533
private Tuple getNextTuple()
    {
    if( nextTuple_ == null)
      {
      // Still traversing values for current start variable?
      int tupleSize = getTupleSize();
      if( !(values_ != null && values_.hasNext()))
        {
        // No, still traversing subtuples for current start variable?
        values_ = null;
        subTuple_ = null;
        if( !(subTuples_ != null && subTuples_.hasNext()))
          {
          // No, advance to next start variable.
          subTuples_ = null;
          varStart_++;
          if( tupleSize > 1)
            {
            for( ;
                 varStart_ < varEnd_
                   &&
                   (subTuples_ = new TupleIterator( tupleSize - 1, varDefs_.subList( varStart_ + 1, varDefs_.size()), randSeq_))
                   .hasNext() == false;

                 varStart_++);
            }
          }
        }

      // More tuples remaining?
      if( varStart_ < varEnd_)
        {
        VarDef startVarDef = varDefs_.get( varStart_);
        if( values_ == null)
          {
          // Resume traversing values for current start variable.
          values_ = RandSeq.reorderIf( randSeq_, startVarDef.getValidValues());
          if( !values_.hasNext())
            {
            throw new IllegalStateException( "Can't complete tuples -- no valid values defined for var=" + startVarDef);
            }
          if( tupleSize > 1)
            {
            // Advance to next subtuple for current start variable.
            subTuple_ = subTuples_.next();
            }
          }

        nextTuple_ = new Tuple();
        nextTuple_.add( new VarBindingDef( startVarDef, values_.next()));
        if( subTuple_ != null)
          {
          nextTuple_.addAll( subTuple_);
          }
        }
      }

    return nextTuple_;
    }
93853
def read_all(tuple)
      template = WaitTemplateEntry.new(self, tuple, nil)
      synchronize do
        entry = @bag.find_all(template)
        entry.collect do |e|
          e.value
        end
      end
    end
186112
def parse_list(lexer: Lexer, is_const: bool) -> ListValueNode:
    """"""
    start = lexer.token
    item = parse_const_value if is_const else parse_value_value
    return ListValueNode(
        values=any_nodes(lexer, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
        loc=loc(lexer, start),
    )
923545
def collect_tokens_until(self, token_type):
        """"""
        self.next()
        if self.current_token.type == token_type:
            return

        while True:
            yield self.current_token

            self.next()
            if self.current_token.type == token_type:
                return

            if self.current_token.type != 'COMMA':
                raise self.error(f'Expected comma but got '
                                 f'{self.current_token.value!r}')
            self.next()
1094090
def INIT_LIST_EXPR(self, cursor):
        """"""
        values = [self.parse_cursor(child)
                  for child in list(cursor.get_children())]
        return values
975040
def complete_value
      if last_token_is(COMPARISON_OPERATORS)
        token = tokens[tokens.size - 2]
        val = ''
      else
        token = tokens[tokens.size - 3]
        val = tokens[tokens.size - 1]
      end

      field = definition.field_by_name(token)
      return [] unless field && field.complete_value

      return complete_set(field) if field.set?
      return complete_date_value if field.temporal?
      return complete_key_value(field, token, val) if field.key_field

      special_values = field.special_values.select { |v| v =~ /\A#{val}/ }
      special_values + complete_value_from_db(field, special_values, val)
    end
118350
def fetch(index, tokens):
    
    if len(tokens) == 0:
        return set()
    return set.intersection(*[set(index.get(token, [])) for token in tokens])