<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_installed_packages(site_packages, site_packages_64):
 """ Returns a dict of installed packages that Zappa cares about. """

        import pkg_resources

        package_to_keep = []
        if os.path.isdir(site_packages):
            package_to_keep += os.listdir(site_packages)
        if os.path.isdir(site_packages_64):
            package_to_keep += os.listdir(site_packages_64)

        package_to_keep = [x.lower() for x in package_to_keep]

        installed_packages = {package.project_name.lower(): package.version for package in
                              pkg_resources.WorkingSet()
                              if package.project_name.lower() in package_to_keep
                              or package.location.lower() in [site_packages.lower(), site_packages_64.lower()]}

        return installed_packages