resolve a list of tokens to an child object

        :param list ts: list of tokens
438709
def resolve(self, ts):
        
        if isinstance(ts, six.string_types):
            ts = [ts]

        obj = self
        while len(ts) > 0:
            t = ts.pop(0)

            if issubclass(obj.__class__, BaseObj):
                obj = getattr(obj, t)
            elif isinstance(obj, list):
                obj = obj[int(t)]
            elif isinstance(obj, dict):
                obj = obj[t]

        return obj
974143
def strids2ids(tokens: Iterable[str]) -> List[int]:
    
    return list(map(int, tokens))
534159
def lazy_list_handle(tokens):
    """"""
    if len(tokens) == 0:
        return "_coconut.iter(())"
    else:
        return (
            "(%s() for %s in (" % (func_var, func_var)
            + "lambda: " + ", lambda: ".join(tokens) + ("," if len(tokens) == 1 else "") + "))"
        )
1284362
function handleExprList (node, options) {
  const values = node.value.map((valueNode) => traverse(valueNode, options)).join(',')
  return `(${values})`
}
1185828
def join(tokens, start, result):
    """"""
    texts = []
    if len(result) > 0:
        for e in result:
            for child in e.iter():
                if child.text is not None:
                    texts.append(child.text)
        return [E(result[0].tag, ' '.join(texts))]
806055
def zs(inlist):
    
    zscores = []
    for item in inlist:
        zscores.append(z(inlist, item))
    return zscores
659523
def prefix_list(self, prefix, values):
        
        return list(map(lambda value: prefix + " " + value, values))
902720
def p_fromitem_list(self,t):
    
    if len(t)==2: t[0] = [t[1]]
    elif len(t)==4: t[0] = t[1] + [t[3]]
    else: raise NotImplementedError('unk_len', len(t)) # pragma: no cover
1337743
def handle_annotation_list(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        
        annotation = tokens['name']
        self.raise_for_redefined_annotation(line, position, annotation)
        self.annotation_to_local[annotation] = set(tokens['values'])
        return tokens
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),
    )
182742
def solve_resolve(expr, vars):
    
    objs, _ = __solve_for_repeated(expr.lhs, vars)
    member = solve(expr.rhs, vars).value

    try:
        results = [structured.resolve(o, member)
                   for o in repeated.getvalues(objs)]
    except (KeyError, AttributeError):
        # Raise a better exception for the non-existent member.
        raise errors.EfilterKeyError(root=expr.rhs, key=member,
                                     query=expr.source)
    except (TypeError, ValueError):
        # Is this a null object error?
        if vars.locals is None:
            raise errors.EfilterNoneError(
                root=expr, query=expr.source,
                message="Cannot resolve member %r from a null." % member)
        else:
            raise
    except NotImplementedError:
        raise errors.EfilterError(
            root=expr, query=expr.source,
            message="Cannot resolve members from a non-structured value.")

    return Result(repeated.meld(*results), ())
554509
def visit_list(self, node):
        """"""
        return "[%s]" % ", ".join(child.accept(self) for child in node.elts)
629177
public static List<TokensLine> convert(List<TokenEntry> tokens) {
    List<TokensLine> result = new ArrayList<>();
    StringBuilder sb = new StringBuilder();
    int startLine = Integer.MIN_VALUE;
    int startIndex = 0;
    int currentIndex = 0;
    for (TokenEntry token : tokens) {
      if (token != TokenEntry.EOF) {
        String value = token.getValue();
        int line = token.getBeginLine();
        if (line != startLine) {
          addNewTokensLine(result, startIndex, currentIndex, startLine, sb);
          startIndex = currentIndex + 1;
          startLine = line;
        }
        currentIndex++;
        sb.append(value);
      }
    }
    addNewTokensLine(result, startIndex, currentIndex, startLine, sb);
    return result;
  }
905914
def convert_tokens_into_matrix(self, token_list):
        '''
        
        '''
        return np.array(self.vectorize(token_list)).astype(np.float32)
21910
def handle_has_members(self, _, __, tokens: ParseResults) -> ParseResults:
        """"""
        return self._handle_list_helper(tokens, HAS_MEMBER)
478908
public List<Type> capture(List<Type> ts) {
        List<Type> buf = List.nil();
        for (Type t : ts) {
            buf = buf.prepend(capture(t));
        }
        return buf.reverse();
    }
537564
private static List<Token> addParentheses(List<Token> tokens) {
        List<Token> result = new ArrayList<Token>();
        result.add(new Token(TokenType.OPENING, "("));
        for (Token token : tokens) {
            if (token.type == TokenType.OR) {
                result.add(new Token(TokenType.CLOSING, ")"));
                result.add(token);
                result.add(new Token(TokenType.OPENING, "("));
            } else {
                result.add(token);
            }
        }
        result.add(new Token(TokenType.CLOSING, ")"));
        return result;
    }