code: def extract_comments(directory):
      for parent, dir_names, file_names in os.walk(directory):
          for file_name in file_names:
              if (
                  os.path.splitext(file_name)[1] == ".py"
                  and file_name != "__init__.py"
              ):
                  # with open
                  doc = get_comments_str(
                      os.path.join(parent, file_name)
                  )
                  directory_out = os.path.join(
                      "docs", parent.replace(directory, "")
                  )
                  if not os.path.exists(directory_out):
                      os.makedirs(directory_out)
  
                  output_file = open(
                      os.path.join(
                          directory_out, file_name[:-3] + ".md"
                      ),
                      "w",
                  )
                  output_file.write(doc)
                  output_file.close()
  
file_path: image-super-resolution/mkdocs/autogen.py
imports: import ast
  import os
  import re
label_desc: Use image node_id 11 for calling a global function with example usage: extract_comments(directory) without return types