code: def summarize_methdods_and_functions(
      api_modules,
      out_dir,
      printlog=False,
      clean=True,
      str_above_header="",
  ):
      """Generates subpacke-level summary files.
  
      Description
      -----------
      A function to generate subpacke-level summary markdown API files from
      a module-level API documentation previously created via the
      `generate_api_docs` function.
      The output structure is:
          package/package.subpackage.md
  
      Parameters
      ----------
      api_modules : str
          Path to the API documentation crated via `generate_api_docs`
      out_dir : str
          Path to the desired output directory for the new markdown files.
      clean : bool (default: False)
          Removes previously existing API directory if True.
      printlog : bool (default: True)
          Prints a progress log to the standard output screen if True.
      str_above_header : str (default: '')
          Places a string just above the header.
  
      """
      if printlog:
          print("\n\nGenerating Subpackage Files\n%s\n" % (50 * "="))
  
      if clean:
          if os.path.isdir(out_dir):
              shutil.rmtree(out_dir)
  
      if not os.path.isdir(out_dir):
          os.mkdir(out_dir)
          if printlog:
              print("created %s" % out_dir)
  
      subdir_paths = [
          os.path.join(api_modules, d)
          for d in os.listdir(api_modules)
          if not d.startswith(".")
      ]
  
      out_files = [
          os.path.join(out_dir, os.path.basename(d)) + ".md"
          for d in subdir_paths
      ]
  
      for sub_p, out_f in zip(subdir_paths, out_files):
          module_paths = (
              os.path.join(sub_p, m)
              for m in os.listdir(sub_p)
              if not m.startswith(".")
          )
  
          new_output = []
          if str_above_header:
              new_output.append(str_above_header)
          for p in sorted(module_paths):
              with open(p, "r") as r:
                  new_output.extend(r.readlines())
                  new_output.extend(["\n", "\n", "\n"])
  
          msg = ""
          if not os.path.isfile(out_f):
              msg = "created"
  
          if msg != "created":
              with open(out_f, "r") as f:
                  prev = f.readlines()
              if prev != new_output:
                  msg = "updated"
              else:
                  msg = "skipped"
  
          if msg != "skipped":
              with open(out_f, "w") as f:
                  f.write("".join(new_output))
  
          if printlog:
              print("%s %s" % (msg, out_f))
  
file_path: mlxtend/docs/make_api.py
imports: import inspect
  import os
  import pkgutil
  import shutil
  import sys
label_desc: Use image node_id 10 for calling a global function with example usage: summarize_methdods_and_functions(api_modules, out_dir, printlog, clean, str_above_header) without return types