code: def write_all_agents():
      """
      Write list of agents to fout.
  
      :param fout:
          file object to write to
      """
      os.makedirs("agent_refs", exist_ok=True)
      agents = [
          name
          for _, name, _ in pkgutil.iter_modules(parlai.agents.__path__)
      ]
      for agent in agents:
          with open(f"agent_refs/{agent}.md", "w") as fout:
              fout.write("".join(prepare_agent_readme(agent)))
  
file_path: ParlAI/docs/source/generate_agent_list.py
imports: import parlai.core.agents
  import parlai.agents
  from parlai.core.params import ParlaiParser
  import argparse
  import os
  import pkgutil
  import importlib
  import inspect
label_desc: Use image node_id 3 for calling a global function with example usage: write_all_agents() without return types