code: def has_module (name, without_error=True):
      
      try:
          importlib.import_module(name)
          return True
      except ImportError:
          return False
      except Exception:
          # some modules raise errors when intitializing
          return not without_error
docs: Test if given module can be imported.
      @param without_error: True if module must not throw any errors when importing
      @return: flag if import is successful
      @rtype: bool