encaps_list : encaps_list ENCAPSED_AND_WHITESPACE
493614
def p_encaps_list_string(p):
    ''
    if p[1] == '':
        p[0] = p[2].decode('string_escape')
    else:
        p[0] = ast.BinaryOp('.', p[1], p[2].decode('string_escape'),
                            lineno=p.lineno(2))
994301
def missing_whitespace(logical_line):
    
    """
    line = logical_line
    for index in range(len(line) - 1):
        char = line[index]
        if char in ',;:' and line[index + 1] not in WHITESPACE:
            before = line[:index]
            if char == ':' and before.count('[') > before.count(']') and \
                    before.rfind('{') < before.rfind('['):
                continue  # Slice syntax, no space required
            if char == ',' and line[index + 1] == ')':
                continue  # Allow tuple with only one element: (3,)
            yield index, "E231 missing whitespace after '%s'" % char
301822
function spaceSeparatedList(query, node, info) {
  var val

  if (!has(node, info.property)) {
    return false
  }

  val = node.properties[info.property]

  /* If this is a comma-separated list, and the query is contained in it,
   * return true. */
  if (
    typeof val === 'object' &&
    !info.commaSeparated &&
    val.indexOf(query.value) !== -1
  ) {
    return true
  }

  /* For all other values (including comma-separated lists),
   * return whether this is an exact match. */
  return normalizeValue(val, info) === query.value
}
821706
def _whitespace_tokenize(self, text):
        """"""
        text = text.strip()
        tokens = text.split()
        return tokens
1198437
def ensure_a_list(data):
    """"""
    if not data:
        return []
    if isinstance(data, (list, tuple, set)):
        return list(data)
    if isinstance(data, str):
        data = trimmed_split(data)  # settings.toml,other.yaml
        return data
    return [data]
139743
def lists_from_env(key, default=""):
    
    try:
        val = os.environ.get(key, default)
        lists = val.split(":")
        return [i.split(',') for i in lists]
    except (KeyError, ValueError):
        return []
1145046
def repr_list(_list, indent):
    """"""
    # pprint represents lists and tuples in one row if possible. We want one
    # per row, so we iterate ourselves.
    if _list is None:
        return 'None'
    if isinstance(_list, MutableSequence):
        bm = '['
        em = ']'
    elif isinstance(_list, Iterable):
        bm = '('
        em = ')'
    else:
        raise TypeError("Object must be an iterable, but is a %s" %
                        type(_list))
    ret = bm + '\n'
    for value in _list:
        ret += _indent('%r,\n' % value, 2)
    ret += em
    ret = repr_text(ret, indent=indent)
    return ret.lstrip(' ')
845782
def strip_block_whitespace(string_list):
    """"""
    min_ws = min([(len(x) - len(x.lstrip())) for x in string_list if x != '\n'])
    return [x[min_ws:] if x != '\n' else x for x in string_list]
849452
def _no_trailing_whitespace(relative_path, contents, linter_options):
    """
    del relative_path
    del linter_options

    trailing_whitespace = re.compile(r"(?<![ \t\r\n])[ \t]+$")

    for index, line in enumerate(contents):
        for space in trailing_whitespace.finditer(line):
            assert space.end() == len(line) - 1
            return LinterFailure("Trailing whitespace",
                                 index + 1,
                                 line[:space.start()] + line[space.end():])
1357556
def parse_list(text, off=0, trim=True):
    '''
    
    '''

    if not nextchar(text, off, '('):
        raise s_exc.BadSyntax(at=off, mesg='expected open paren for list')

    off += 1

    valus = []
    while off < len(text):

        _, off = nom(text, off, whites)

        valu, off = parse_valu(text, off)

        _, off = nom(text, off, whites)

        # check for foo=bar kw tuple syntax
        if nextchar(text, off, '='):

            _, off = nom(text, off + 1, whites)

            vval, off = parse_valu(text, off)

            _, off = nom(text, off, whites)

            valu = (valu, vval)

        valus.append(valu)

        _, off = nom_whitespace(text, off)

        if nextchar(text, off, ')'):
            return valus, off + 1

        if not nextchar(text, off, ','):
            raise s_exc.BadSyntax(at=off, text=text, mesg='expected comma in list')

        off += 1

    raise s_exc.BadSyntax(at=off, mesg='unexpected and of text during list')
734673
def match_spaces
      stack = []
      matched = match_space
      while matched != :failed
        stack << matched
        matched = match_space
      end
      stack
    end
4810
def encode_list(key, list_):
    # type: (str, Iterable) -> Dict[str, str]
    
    if not list_:
        return {}
    return {key: " ".join(str(i) for i in list_)}
1120683
def pretty_print_list(lst, name = 'features', repr_format=True):
    
    if not lst or len(lst) < 8:
        if repr_format:
            return lst.__repr__()
        else:
            return ', '.join(map(str, lst))
    else:
        topk = ', '.join(map(str, lst[:3]))
        if repr_format:
            lst_separator = "["
            lst_end_separator = "]"
        else:
            lst_separator = ""
            lst_end_separator = ""

        return "{start}{topk}, ... {last}{end} (total {size} {name})".format(\
                topk = topk, last = lst[-1], name = name, size = len(lst),
                start = lst_separator, end = lst_end_separator)
480920
def list_encoder(values, instance, field: Field):
    """"""
    return [field.to_db_value(element, instance) for element in values]
991787
def trunc_list(s: List) -> List:
    """"""
    if len(s) > max_list_size:
        i = max_list_size // 2
        j = i - 1
        s = s[:i] + [ELLIPSIS] + s[-j:]
    return s
679488
def p_simple_list(p):
    ''''''
    tok = p.lexer
    heredoc.gatherheredocuments(tok)

    if len(p) == 3 or len(p[1]) > 1:
        parts = p[1]
        if len(p) == 3:
            parts.append(ast.node(kind='operator', op=p[2], pos=p.lexspan(2)))
        p[0] = ast.node(kind='list', parts=parts, pos=_partsspan(parts))
    else:
        assert len(p[1]) == 1
        p[0] = p[1][0]

    if (len(p) == 2 and p.lexer._parserstate & flags.parser.CMDSUBST and
            p.lexer._current_token.nopos() == p.lexer._shell_eof_token):
        # accept the input
        p.accept()
1103453
def list_to_serialized(ref, the_list):
    
    result = []
    for elt in the_list:
        if not getattr(elt, 'serialize', None):
            continue
        result.append(elt.serialize())
    return result