code: def _get_packages(add_pckg):
          r
  
          # Mandatory packages
          pckgs = [numpy, scipy, empymod]
  
          # Optional packages
          for module in [IPython, numexpr, matplotlib]:
              if module:
                  pckgs += [module]
  
          # Cast and add add_pckg
          if add_pckg is not None:
  
              # Cast add_pckg
              if isinstance(add_pckg, tuple):
                  add_pckg = list(add_pckg)
  
              if not isinstance(add_pckg, list):
                  add_pckg = [add_pckg, ]
  
              # Add add_pckg
              pckgs += add_pckg
  
          return pckgs
docs: r"""Create list of packages.