Split a string into a list, respecting any quoted strings inside
    Uses ``shelx.split`` which has a bad habbit of inserting null bytes where they are not wanted
554018
def split(s):
    
    return map(lambda w: filter(lambda c: c != '\x00', w), lexsplit(s))
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
1099687
function(str, delimiter){

	var retlist = null;

	if( ! us.isUndefined(str) ){
	    if( us.isUndefined(delimiter) ){
		delimiter = /\s+/;
	    }
	    
	    retlist = str.split(delimiter);
	}

	return retlist;
    }
21393
def split_command(cmd, posix=None):
    '''
     
    '''
    if not isinstance(cmd, string_types):
        # cmd is string list
        pass
    else:
        if not PY3:
            # cmd is string
            # The shlex module currently does not support Unicode input (in
            # 2.x)!
            if isinstance(cmd, unicode):
                try:
                    cmd = unicodedata.normalize(
                        'NFKD', cmd).encode('ascii', 'strict')
                except UnicodeEncodeError:
                    raise EasyProcessUnicodeError('unicode command "%s" can not be processed.' % cmd +
                                                  'Use string list instead of string')
                log.debug('unicode is normalized')
        if posix is None:
            posix = 'win' not in sys.platform
        cmd = shlex.split(cmd, posix=posix)
    return cmd
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;
    } );
}
649047
def _str_to_list(value, separator):
    """"""
    value_list = [item.strip() for item in value.split(separator)]
    value_list_sanitized = builtins.list(filter(None, value_list))
    if len(value_list_sanitized) > 0:
        return value_list_sanitized
    else:
        raise ValueError('Invalid list variable.')
1167785
def parse_str(io, stop_quote)
      buf = ''
      loop do
        c = io.read_one_char
        if c.nil?
          raise Error, "The IO ran out before the end of a literal string"
        elsif buf.length > 0 && buf[-1..-1] == ESC # If this char was escaped
          # Trim the escape character at the end of the buffer
          buf = buf[0..-2] 
          buf << c
        elsif c == stop_quote
          return buf
        else
          buf << c
        end
      end
    end
925931
def split_text(text: str, length: int = MAX_MESSAGE_LENGTH) -> typing.List[str]:
    
    return [text[i:i + length] for i in range(0, len(text), length)]
1293548
def SplitString(value):
    """"""
    string_length = len(value)
    chunks = int(string_length / 10)
    string_list = list(value)
    lstring = ""

    if chunks > 1:
        lstring = "\\markup { \n\r \column { "
        for i in range(int(chunks)):
            lstring += "\n\r\r \\line { \""
            index = i * 10
            for i in range(index):
                lstring += string_list[i]
            lstring += "\" \r\r}"
        lstring += "\n\r } \n }"
    if lstring == "":
        indexes = [
            i for i in range(
                len(string_list)) if string_list[i] == "\r" or string_list[i] == "\n"]
        lstring = "\\markup { \n\r \column { "
        if len(indexes) == 0:
            lstring += "\n\r\r \\line { \"" + \
                "".join(string_list) + "\" \n\r\r } \n\r } \n }"
        else:
            rows = []
            row_1 = string_list[:indexes[0]]
            rows.append(row_1)
            for i in range(len(indexes)):
                start = indexes[i]
                if i != len(indexes) - 1:
                    end = indexes[i + 1]
                else:
                    end = len(string_list)
                row = string_list[start:end]
                rows.append(row)

            for row in rows:
                lstring += "\n\r\r \\line { \""
                lstring += "".join(row)
                lstring += "\" \r\r}"
            lstring += "\n\r } \n }"
    return lstring
1276876
def tsplit(string, delimiters):
    """"""
    delimiters = tuple(delimiters)
    if len(delimiters) < 1:
        return [string,]
    final_delimiter = delimiters[0]
    for i in delimiters[1:]:
        string = string.replace(i, final_delimiter)
    return string.split(final_delimiter)
421376
def comma_list(cls, string):
        ''''''
        items = string.split(',')
        items = list([item.strip() for item in items])
        return items
414046
def list2string (inlist,delimit=' '):
    
    stringlist = [makestr(_) for _ in inlist]
    return string.join(stringlist,delimit)
292250
def tokenize(text=""):
    
    if text == '':
        return []
    else:
        # split tokens
        mylist = TOKEN_PATTERN.split(text)
        # don't remove newline \n
        mylist = [TOKEN_REPLACE.sub('', x) for x in mylist if x]
        # remove empty substring
        mylist = [x for x in mylist if x]
        return mylist
693232
def p_string_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]]
1349956
def split_args(line):
    
    lex = shlex.shlex(line, posix=True)
    lex.whitespace_split = True
    lex.commenters = ''
    res = []
    try:
        while True:
            res.append(next(lex))
    except ValueError:  # No closing quotation
        pass
    except StopIteration:  # End of loop
        pass
    if lex.token:
        res.append(lex.token)
    return res
772085
function splitArgsFromString(argsString) {
  let result = [];
  const quoteSeparatedArgs = argsString.split(/(\x22[^\x22]*\x22)/).filter(x => x);
  quoteSeparatedArgs.forEach(arg => {
    if (arg.match('\x22')) {
      result.push(arg.replace(/\x22/g, ''));
    } else {
      result = result.concat(arg.trim().split(' '));
    }
  });
  return result;
}
1301519
def split_qs(string, delimiter='&'):
    """"""

    open_list = '[<{('
    close_list = ']>})'
    quote_chars = '"\''

    level = index = last_index = 0
    quoted = False
    result = []

    for index, letter in enumerate(string):
        if letter in quote_chars:
            if not quoted:
                quoted = True
                level += 1
            else:
                quoted = False
                level -= 1
        elif letter in open_list:
            level += 1
        elif letter in close_list:
                level -= 1
        elif letter == delimiter and level == 0:
            # Split here
            element = string[last_index: index]
            if element:
                result.append(element)
            last_index = index + 1

    if index:
        element = string[last_index: index + 1]
        if element:
            result.append(element)

    return result