code: def format_modulemember(name, directive):
      parts = name.split(".")
      mod, name = ".".join(parts[:-1]), parts[-1]
      return f".. currentmodule:: {mod}\n\n.. {directive}:: {name}\n"
  
file_path: nipy/doc/sphinxext/autosummary_generate.py
imports: import glob
  import inspect
  import optparse
  import os
  import pydoc
  import re
  from autosummary import import_by_name
label_desc: Use image node_id 2 for calling a global function with example usage: format_modulemember(name, directive) and returns: str, mod, str, directive, str, name, str