code: def generate_apidocs(*args):
      """Generate API docs automatically by trawling the available modules"""
      global working_dir, module_path
      output_path = working_dir
      apidoc_command_path = "sphinx-apidoc"
      if hasattr(sys, "real_prefix"):  # called from a virtualenv
          apidoc_command_path = os.path.join(
              sys.prefix, "bin", "sphinx-apidoc"
          )
          apidoc_command_path = os.path.abspath(apidoc_command_path)
      subprocess.check_call(
          [apidoc_command_path, "-f", "--separate"]
          + ["-o", output_path, module_path]
          + [
              os.path.join(root_dir_abs, pattern)
              for pattern in exclude_patterns
          ]
      )
  
imports: import subprocess
  import os
  import sys
  from recommonmark.parser import CommonMarkParser
  import sphinx_nameko_theme
  from niftynet.utilities.versioning import get_niftynet_version
label_desc: Use image node_id 1 for calling a global function with example usage: generate_apidocs() without return types