code: def linkify_docs(library: str, docs_dir: pathlib.Path, verbose=False):
      shutil.rmtree(docs_dir.joinpath("linkified"), ignore_errors=True)
      shutil.copytree(
          src=docs_dir,
          dst=docs_dir.joinpath("linkified"),
          dirs_exist_ok=True,
      )
      linkifier = Linkifier(library=library)
  
      for page in docs_dir.glob("**/*.md"):
          # Ignore files in the linkified directory
          if str(page).startswith("docs/linkified"):
              continue
  
          text = page.read_text()
          prefix = "../" * (str(page).count("/") - 1)
  
          if "/api/" not in str(page):
              prefix = f"../{prefix}api/"
  
          if "benchmarks" not in str(page):
              if verbose:
                  print(f"Adding links to {page}")
              text = linkifier.linkify(text, prefix=prefix)
  
          # Write back text to file
          linkified_page = pathlib.Path(
              str(page).replace("docs/", "docs/linkified/")
          )
          linkified_page.write_text(text)
  
imports: import argparse
  import collections
  import doctest
  import functools
  import importlib
  import inspect
  import os
  import pathlib
  import re
  import shutil
  from numpydoc.docscrape import ClassDoc, FunctionDoc
label_desc: Use image node_id 16 for calling a global function with example usage: linkify_docs(library, docs_dir, verbose) without return types