code: def directory_generator(req, base="/opt/fw/"):
      for versions in req:
          if "/" in versions:
              pkg, ver = versions.split("/")
              path = base + pkg + "/" + ver
              if not os.path.exists(path):
                  install_pkg(path, pkg + "==" + ver)
          else:
              install_pkg(base + versions, versions)
  
imports: import os
  import subprocess
  import sys
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: directory_generator(req, base) without return types