import subprocess


class Package(object):
    """Metadata on a Pacman package."""

    def __init__(self, name, version):
        self.name = name
        self.version = version

    def __eq__(self, other):
        return (isinstance(other, Package) and
            self.name == other.name and self.version == other.version)

    def __repr__(self):
        class_ = self.__class__
        return '<%s.%s %s version=%s>' % (
            class_.__module__, class_.__qualname__, self.name, self.version
        )


class LocalPackageSet(object):
    """Collection for metadata on installed packages."""

    def __init__(self):
        output = subprocess.run(
            ['pacman', '-Q'], stdout=subprocess.PIPE, check=True
        ).stdout.decode()
        packages = output.split('\n')
        packages.pop() # Remove extra empty string due to trailing newline
        self.packages = {}
        for p in packages:
            p = p.split()
            self.packages[p[0]] = Package(p[0], p[1])

    def get(self, package_name):
        """Get metadata on the package with the given name.

        This returns a Package object if the package is installed, or None if
        the package is not installed.
        """
        return self.packages.get(package_name)

@@ -116,16 +116,164 @@
 rsion):%0A
+        %22%22%22%0A        Args:%0A            name: package name%0A            version: package version (including release number) (e.g. %221.2-3%22)%0A        %22%22%22%0A
         
@@ -1247,22 +1247,112 @@
     
-This returns a
+Args:%0A            package_name: name of package to retrieve metadata for%0A%0A        Returns:%0A            A
  Pac
@@ -1402,16 +1402,20 @@
  None if
+ the
 %0A       
@@ -1415,19 +1415,19 @@
         
-the
+   
  package

Use Google-style doc strings