code: def is_installed(name):
      
      pkgs = installed_packages()
      for pkge in pkgs:
          if pkge.name == name:
              return True
      return False
docs: Checks whether a package with the name is already installed.
  
      :param name: the name of the package
      :type name: str
      :return: whether the package is installed
      :rtype: bool