def _split_conditional(string):
 bracks_open = 0
 args = []
 carg = ''
 escaped = False
 for (idx, char) in enumerate(string):
  if (char == '('):
   if (not escaped):
    bracks_open += 1
  elif (char == ')'):
   if (not escaped):
    bracks_open -= 1
  elif ((char == ':') and (not bracks_open) and (not escaped)):
   args.append(carg)
   carg = ''
   escaped = False
   continue
  carg += char
  if (char == '\\'):
   escaped = (not escaped)
  else:
   escaped = False
 args.append(carg)
 return args

def _split_conditional ( string ) : bracks_open = 0 args = [ ] carg = '' escaped = False for ( idx , char ) in enumerate ( string ) : if ( char == '(' ) : if ( not escaped ) : bracks_open += 1 elif ( char == ')' ) : if ( not escaped ) : bracks_open -= 1 elif ( ( char == ':' ) and ( not bracks_open ) and ( not escaped ) ) : args . append ( carg ) carg = '' escaped = False continue carg += char if ( char == '\\' ) : escaped = ( not escaped ) else : escaped = False args . append ( carg ) return args
split the given conditional string into its arguments .