<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upgrade_packages(self, packages):
 """ Upgrade all specified packages to latest version """


        print("Upgrading packages\n")

        package_list = []
        requirements = self._parse_requirements(packages.readlines())
        for (package, version) in requirements:
            package_list.append(package)

        if package_list:
            args = [
                "pip",
                "install",
                "-U",
            ]
            args.extend(package_list)
            subprocess.check_call(args)
        else:
            print("No packages to upgrade")