code: def visit_module(module, done=None):
      skip = {
          "__doc__",
          "__name__",
          "__loader__",
          "__spec__",
          "__file__",
          "__package__",
          "__builtins__",
      }
  
      done = set() if done is None else done
      lines = Lines()
  
      keys = list(module.__dict__.keys())
      keys.sort(key=lambda name: name.startswith("_"))
  
      constants = [
          (name, getattr(module, name))
          for name in keys
          if all(
              (
                  name not in done and name not in skip,
                  isinstance(getattr(module, name), int),
              )
          )
      ]
      for name, value in constants:
          done.add(name)
          if name in OVERRIDE:
              lines.add = OVERRIDE[name]
          else:
              lines.add = visit_constant((name, value))
      if constants:
          lines.add = ""
  
      for name in keys:
          if name in done or name in skip:
              continue
          value = getattr(module, name)
  
          if is_class(value):
              done.add(name)
              lines.add = visit_class(value)
              lines.add = ""
              aliases = [
                  (k, getattr(module, k))
                  for k in keys
                  if all(
                      (
                          k not in done and k not in skip,
                          getattr(module, k) is value,
                      )
                  )
              ]
              for aliasname, target in aliases:
                  done.add(aliasname)
                  lines.add = f"{aliasname} = {target.__name__}"
              if aliases:
                  lines.add = ""
              instances = [
                  (k, getattr(module, k))
                  for k in keys
                  if all(
                      (
                          k not in done and k not in skip,
                          type(getattr(module, k)) is value,
                      )
                  )
              ]
              for attrname, attrvalue in instances:
                  done.add(attrname)
                  lines.add = visit_constant((attrname, attrvalue))
              if instances:
                  lines.add = ""
              continue
  
          if is_function(value):
              done.add(name)
              if name == value.__name__:
                  lines.add = visit_function(value)
              else:
                  lines.add = f"{name} = {value.__name__}"
              continue
  
      lines.add = ""
      for name in keys:
          if name in done or name in skip:
              continue
          value = getattr(module, name)
          done.add(name)
          if name in OVERRIDE:
              lines.add = OVERRIDE[name]
          else:
              lines.add = visit_constant((name, value))
  
      leftovers = [
          name for name in keys if name not in done and name not in skip
      ]
      if leftovers:
          raise RuntimeError(f"leftovers: {leftovers}")
      return lines
  
imports: import os
  import inspect
  import textwrap
label_desc: Use image node_id 18 for calling a global function with example usage: visit_module(module, done) and returns: lines