code: def _make_pretty_usage(infos):
      """
      Makes the usage description pretty and returns a formatted string.
  
      Expected input:
  
          func(*) - ...
  
          func(expr[, expr...]) - ...
  
      Expected output:
      <table class="table">
        <thead>
          <tr>
            <th style="width:25%">Function</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>func(*)</td>
            <td>...</td>
          </tr>
          <tr>
            <td>func(expr[, expr...])</td>
            <td>...</td>
          </tr>
        </tbody>
        ...
      </table>
  
      """
  
      result = []
      result.append('<table class="table">')
      result.append("  <thead>")
      result.append("    <tr>")
      result.append('      <th style="width:25%">Function</th>')
      result.append("      <th>Description</th>")
      result.append("    </tr>")
      result.append("  </thead>")
      result.append("  <tbody>")
  
      for info in infos:
          # Extracts (signature, description) pairs from `info.usage`.
          # Expected formats are as follows;
          #  - `_FUNC_(...) - description`, or
          #  - `_FUNC_ - description`
          func_name = info.name
          if info.name == "*" or info.name == "+":
              func_name = "\\" + func_name
          elif info.name == "when":
              func_name = "CASE WHEN"
          usages = iter(
              re.split(r"(.*%s.*) - " % func_name, info.usage.strip())[
                  1:
              ]
          )
          for sig, description in zip(usages, usages):
              result.append("    <tr>")
              result.append("      <td>%s</td>" % sig)
              result.append("      <td>%s</td>" % description.strip())
              result.append("    </tr>")
  
      result.append("  </tbody>")
      result.append("</table>\n")
      return "\n".join(result)
  
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 2 for calling a global function with example usage: _make_pretty_usage(infos) and returns: str