code: def _list_grouped_function_infos(jvm):
      """
      Returns a list of function information grouped by each group value via JVM.
      Sorts wrapped expression infos in each group by name and returns them.
      """
  
      jinfos = (
          jvm.org.apache.spark.sql.api.python.PythonSQLUtils.listBuiltinFunctionInfos()
      )
      infos = []
  
      for jinfo in filter(lambda x: x.getGroup() in groups, jinfos):
          name = jinfo.getName()
          if name == "raise_error":
              continue
  
          # SPARK-45232: convert lambda_funcs to collection_funcs in doc generation
          group = jinfo.getGroup()
          if group == "lambda_funcs":
              group = "collection_funcs"
  
          usage = jinfo.getUsage()
          usage = (
              usage.replace("_FUNC_", name)
              if usage is not None
              else usage
          )
          infos.append(
              ExpressionInfo(
                  name=name,
                  usage=usage,
                  examples=jinfo.getExamples().replace("_FUNC_", name),
                  group=group,
              )
          )
  
      # Groups expression info by each group value
      grouped_infos = itertools.groupby(
          sorted(infos, key=lambda x: x.group), key=lambda x: x.group
      )
      # Then, sort expression infos in each group by name
      return [
          (k, sorted(g, key=lambda x: x.name)) for k, g in grouped_infos
      ]
  
file_path: spark/sql/gen-sql-functions-docs.py
imports: import itertools
  import os
  import re
  from collections import namedtuple
  from mkdocs.structure.pages import markdown
  from pyspark.java_gateway import launch_gateway
label_desc: Use image node_id 1 for calling a global function with example usage: _list_grouped_function_infos(jvm) and returns: unknown