code: def _make_pretty_examples(jspark, infos):
      """
      Makes the examples description pretty and returns a formatted string if `infos`
      has any `examples` starting with the example prefix. Otherwise, returns None.
  
      Expected input:
  
          Examples:
            > SELECT func(col)...;
             ...
            > SELECT func(col)...;
             ...
  
      Expected output:
      <div class="codehilite"><pre><span></span>
        <span class="c1">-- func</span>
        <span class="k">SELECT</span>
        ...
      </pre></div>
      ```
  
      """
  
      pretty_output = ""
      for info in infos:
          if info.examples.startswith("\n    Examples:"):
              output = []
              output.append("-- %s" % info.name)
              query_examples = filter(
                  lambda x: x.startswith("      > "),
                  info.examples.split("\n"),
              )
              for query_example in query_examples:
                  query = query_example.lstrip("      > ")
                  print("    %s" % query)
                  query_output = jspark.sql(query).showString(
                      20, 20, False
                  )
                  output.append(query)
                  output.append(query_output)
              pretty_output += "\n" + "\n".join(output)
      if pretty_output != "":
          return markdown.markdown(
              "```sql%s```" % pretty_output,
              extensions=["codehilite", "fenced_code"],
          )
  
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 3 for calling a global function with example usage: _make_pretty_examples(jspark, infos) and returns: markdown