def splitQuoted(s):
 s = s.strip()
 result = []
 word = []
 inQuote = inWord = False
 for (i, c) in enumerate(iterbytes(s)):
  if (c == '"'):
   if (i and (s[(i - 1):i] == '\\')):
    word.pop()
    word.append('"')
   elif (not inQuote):
    inQuote = True
   else:
    inQuote = False
    result.append(''.join(word))
    word = []
  elif ((not inWord) and (not inQuote) and (c not in ('"' + string.whitespace.encode('ascii')))):
   inWord = True
   word.append(c)
  elif (inWord and (not inQuote) and (c in string.whitespace.encode('ascii'))):
   w = ''.join(word)
   if (w == 'NIL'):
    result.append(None)
   else:
    result.append(w)
   word = []
   inWord = False
  elif (inWord or inQuote):
   word.append(c)
 if inQuote:
  raise MismatchedQuoting(s)
 if inWord:
  w = ''.join(word)
  if (w == 'NIL'):
   result.append(None)
  else:
   result.append(w)
 return result

def splitQuoted ( s ) : s = s . strip ( ) result = [ ] word = [ ] inQuote = inWord = False for ( i , c ) in enumerate ( iterbytes ( s ) ) : if ( c == '"' ) : if ( i and ( s [ ( i - 1 ) : i ] == '\\' ) ) : word . pop ( ) word . append ( '"' ) elif ( not inQuote ) : inQuote = True else : inQuote = False result . append ( '' . join ( word ) ) word = [ ] elif ( ( not inWord ) and ( not inQuote ) and ( c not in ( '"' + string . whitespace . encode ( 'ascii' ) ) ) ) : inWord = True word . append ( c ) elif ( inWord and ( not inQuote ) and ( c in string . whitespace . encode ( 'ascii' ) ) ) : w = '' . join ( word ) if ( w == 'NIL' ) : result . append ( None ) else : result . append ( w ) word = [ ] inWord = False elif ( inWord or inQuote ) : word . append ( c ) if inQuote : raise MismatchedQuoting ( s ) if inWord : w = '' . join ( word ) if ( w == 'NIL' ) : result . append ( None ) else : result . append ( w ) return result
like string .