code: def get_sw_dir(sw_dir=None):
      
      if sw_dir is None:
          sw_dir = Config.instance().get("core", "software_dir")
  
      sw_dir = os.path.expandvars(os.path.expanduser(sw_dir))
  
      return sw_dir
docs: Returns the software directory defined in the ``config.software_dir`` config. When *sw_dir* is
      not *None*, it is expanded and returned instead.