def add_space_separation(funql):
  """Split funql and join with space separator."""
  separators = "(),"
  buffer = ""
  symbols = []
  for char in funql:
    if char in separators:
      if buffer:
        symbols.append(buffer)
        buffer = ""
      symbols.append(char)
    else:
      buffer += char
  if buffer:
    symbols.append(buffer)
  return " ".join(symbols)
Split funql and join with space separator.
language/compgen/nqg/tasks/geoquery/funql_normalization.py