Split the text including multiple arguments to list.

        This function uses a comma to separate arguments and ignores a comma in
        brackets ans quotes.
331651
def split_args_text_to_list(self, args_text):
        
        args_list = []
        idx_find_start = 0
        idx_arg_start = 0

        try:
            pos_quote = self._find_quote_position(args_text)
            pos_round = self._find_bracket_position(args_text, '(', ')',
                                                    pos_quote)
            pos_curly = self._find_bracket_position(args_text, '{', '}',
                                                    pos_quote)
            pos_square = self._find_bracket_position(args_text, '[', ']',
                                                     pos_quote)
        except IndexError:
            return None

        while True:
            pos_comma = args_text.find(',', idx_find_start)

            if pos_comma == -1:
                break

            idx_find_start = pos_comma + 1

            if self.is_char_in_pairs(pos_comma, pos_round) or \
                    self.is_char_in_pairs(pos_comma, pos_curly) or \
                    self.is_char_in_pairs(pos_comma, pos_square) or \
                    self.is_char_in_pairs(pos_comma, pos_quote):
                continue

            args_list.append(args_text[idx_arg_start:pos_comma])
            idx_arg_start = pos_comma + 1

        if idx_arg_start < len(args_text):
            args_list.append(args_text[idx_arg_start:])

        return args_list
670253
def split_args_list(tokens, loc):
    """"""
    req_args, def_args, star_arg, kwd_args, dubstar_arg = [], [], None, [], None
    pos = 0
    for arg in tokens:
        if len(arg) == 1:
            if arg[0] == "*":
                # star sep (pos = 3)
                if pos >= 3:
                    raise CoconutDeferredSyntaxError("star separator at invalid position in function definition", loc)
                pos = 3
            else:
                # pos arg (pos = 0)
                if pos > 0:
                    raise CoconutDeferredSyntaxError("positional arguments must come first in function definition", loc)
                req_args.append(arg[0])
        elif len(arg) == 2:
            if arg[0] == "*":
                # star arg (pos = 2)
                if pos >= 2:
                    raise CoconutDeferredSyntaxError("star argument at invalid position in function definition", loc)
                pos = 2
                star_arg = arg[1]
            elif arg[0] == "**":
                # dub star arg (pos = 4)
                if pos == 4:
                    raise CoconutDeferredSyntaxError("double star argument at invalid position in function definition", loc)
                pos = 4
                dubstar_arg = arg[1]
            else:
                # def arg (pos = 1)
                if pos <= 1:
                    pos = 1
                    def_args.append((arg[0], arg[1]))
                # kwd arg (pos = 3)
                elif pos <= 3:
                    pos = 3
                    kwd_args.append((arg[0], arg[1]))
                else:
                    raise CoconutDeferredSyntaxError("invalid default argument in function definition", loc)
        else:
            raise CoconutInternalException("invalid function definition argument", arg)
    return req_args, def_args, star_arg, kwd_args, dubstar_arg
219348
def string_to_list(string, sep=",", filter_empty=False):
    """"""
    return [value.strip() for value in string.split(sep)
            if (not filter_empty or value)]
184331
function splitArgObjects (args) {
  const newArgs = []
  let index = 0

  while (index < args.length) {
    const arg = args[index]

    if (arg.indexOf('{') !== -1) {
      const temp = []

      while (args[index].indexOf('}') === -1) {
        temp.push(args[index])
        index++
      }
      temp.push(args[index])

      newArgs.push(temp.join(' ').replace(/([\w\d-]+):\s*([\w\d-]*)/g, '"$1": "$2"'))
    } else {
      newArgs.push(arg)
    }

    index++
  }

  return newArgs
}
90188
function split( command ) {
    if ( typeof command !== 'string' ) {
        throw new Error( 'Command must be a string' );
    }

    var r = command.match( /[^"\s]+|"(?:\\"|[^"])*"/g );
    if ( ! r ) {
        return [];
    }

    return r.map( function ( expr ) {
        var isQuoted = expr.charAt( 0 ) === '"' && expr.charAt( expr.length - 1 ) === '"';
        return isQuoted ? expr.slice( 1, -1 ) : expr;
    } );
}
394342
def tokenize(cls, text, mode='c'):
        
        if mode == 'c':
            return [ch for ch in text]
        else:
            return [w for w in text.split()]
997634
def multi_split(s, split):
    # type: (S, Iterable[S]) -> List[S]
    """"""
    for r in split:
        s = s.replace(r, "|")
    return [i for i in s.split("|") if len(i) > 0]
1234453
def separate_string(string):
    
    string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string))
    return string_list[::2], string_list[1::2]
237381
def _parse_list(cls, value, separator=','):
        
        if isinstance(value, list):  # _get_parser_compound case
            return value

        if '\n' in value:
            value = value.splitlines()
        else:
            value = value.split(separator)

        return [chunk.strip() for chunk in value if chunk.strip()]
143549
def splitarg(args):
    '''
    
    '''
    if not args:
        return args
    split = list()
    for arg in args:
        if ',' in arg:
            split.extend([x for x in arg.split(',') if x])
        elif arg:
            split.append(arg)
    return split
913312
def comma_choice_list(cls, string):
        ''''''
        items = string.split(',')
        items = CommaChoiceListArgs([item.strip() for item in items])
        return items
556667
def wrap_argument(text):
    
    if not any(x in text for x in [' ', '"', "'", '\\']):
        return text
    else:
        return '"%s"' % (text.replace('\\', r'\\').replace('"', r'\"'), )
1264013
public static List<String> splitTrim(String str, char separator, boolean ignoreEmpty){
		return split(str, separator, 0, true, ignoreEmpty);
	}
1205378
function split(str, separator) {
    separator = separator || '';
    if (_.isString(str)) {
        return str.split(separator);
    } else {
        return str;
    }
}
350223
public static List<String> splitCommaSeparatedList(String text) {
    if (text == null || text.isEmpty()) {
      return Collections.emptyList();
    }
    Matcher matcher = pattern.matcher(text);
    List<String> parts = new ArrayList<String>();
    while(matcher.find()) {
      parts.add(matcher.group().trim());
    }
    return parts;
  }
1101149
def _textToTable(self, text, separator='\t'):
        
        table = None
        if text.startswith('[[') or text.startswith('(('):
            try:
                # maybe it's already formated as a list e.g. "[['1','2'],[...]]"
                # check it:
                t = eval(text)
            # has to be a 2d-list:
                if isinstance(t, list) and isinstance(t[0], list):
                    table = t
            except SyntaxError:
                # not a valid list
                pass
        if not table:
            # create the list from the clipboard-text
            # therefore the text has to be formated like this:
                # "1\t2\3\n4\t5\6\n"
            table = text.split('\n')
            n = 0
            while n < len(table):
                sline = table[n].split(separator)
                if sline != ['']:
                    table[n] = sline
                else:
                    table.pop(n)
                    n -= 1
                n += 1
        return table
733999
def split(self, sep=TOKENS):
        
        if sep != TOKENS:
            return unicode.split(self, sep)
        if len(self) == 0:
            return []
        return [[[x.replace("&slash;", "/") for x in token.split("/")]
            for token in sentence.split(" ")]
                for sentence in unicode.split(self, "\n")]