def _get_name_and_arguments(funql):
  """Returns function name and argument sub-expressions."""
  funql = funql.strip()
  paren_index = funql.find("(")
  if paren_index == -1:
    return funql, None
  name = funql[:paren_index].strip()
  arguments = funql[paren_index + 1:].strip()
  if arguments[-1] != ")":
    raise ValueError("Invalid arguments string ends with %s: %s" %
                     (arguments[-1], arguments))
  arguments = _split_arguments(arguments[:-1])
  return name, arguments
Returns function name and argument sub-expressions.
language/compgen/nqg/tasks/geoquery/tmcd_utils.py