def quote_split(sep,string):
if len(sep) != <NUM_LIT:1>: raise Exception("<STR_LIT>")<EOL>retlist = []<EOL>squote = False<EOL>dquote = False<EOL>left = <NUM_LIT:0><EOL>i = <NUM_LIT:0><EOL>while i < len(string):<EOL><INDENT>if string[i] == '<STR_LIT:">' and not dquote:<EOL><INDENT>if not squote:<EOL><INDENT>squote = True<EOL><DEDENT>elif (i+<NUM_LIT:1>) < len(string) and string[i+<NUM_LIT:1>] == '<STR_LIT:">':<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>squote = False<EOL><DEDENT><DEDENT>elif string[i] == "<STR_LIT:'>" and not squote:<EOL><INDENT>if not dquote:<EOL><INDENT>dquote = True<EOL><DEDENT>elif (i+<NUM_LIT:1>) < len(string) and string[i+<NUM_LIT:1>] == "<STR_LIT:'>":<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>dquote = False            <EOL><DEDENT><DEDENT>elif string[i] == sep and not dquote and not squote:<EOL><INDENT>retlist.append(string[left:i])<EOL>left = i + <NUM_LIT:1><EOL><DEDENT>i += <NUM_LIT:1><EOL><DEDENT>retlist.append(string[left:])<EOL>return retlist<EOL>
Splits the strings into pieces divided by sep, when sep in not inside quotes.