def _convert_function(name, argument_0, arity):
  """Converts a function that contains nested arguments."""
  output_arguments = []
  inner_funql = argument_0
  for _ in range(arity - 1):
    nested_argument, arguments = _get_name_and_arguments(inner_funql)
    if len(arguments) > 1:
      raise ValueError
    inner_funql = arguments[0]
    output_arguments.append(nested_argument)
  output_arguments.append(normalize_funql(inner_funql))
  output = "%s(%s)" % (name, ",".join(output_arguments))
  return output
Converts a function that contains nested arguments.
language/compgen/nqg/tasks/geoquery/funql_normalization.py