def split_qs(string, delimiter='<STR_LIT:&>'):
open_list = '<STR_LIT>'<EOL>close_list = '<STR_LIT>'<EOL>quote_chars = '<STR_LIT>'<EOL>level = index = last_index = <NUM_LIT:0><EOL>quoted = False<EOL>result = []<EOL>for index, letter in enumerate(string):<EOL><INDENT>if letter in quote_chars:<EOL><INDENT>if not quoted:<EOL><INDENT>quoted = True<EOL>level += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>quoted = False<EOL>level -= <NUM_LIT:1><EOL><DEDENT><DEDENT>elif letter in open_list:<EOL><INDENT>level += <NUM_LIT:1><EOL><DEDENT>elif letter in close_list:<EOL><INDENT>level -= <NUM_LIT:1><EOL><DEDENT>elif letter == delimiter and level == <NUM_LIT:0>:<EOL><INDENT>element = string[last_index: index]<EOL>if element:<EOL><INDENT>result.append(element)<EOL><DEDENT>last_index = index + <NUM_LIT:1><EOL><DEDENT><DEDENT>if index:<EOL><INDENT>element = string[last_index: index + <NUM_LIT:1>]<EOL>if element:<EOL><INDENT>result.append(element)<EOL><DEDENT><DEDENT>return result<EOL>
Split a string by the specified unquoted, not enclosed delimiter