<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reference(self, install, upgrade):
 """Reference list with packages installed and upgraded """

        self.template(78)
        print("| Total {0} {1} installed and {2} {3} upgraded".format(
            len(install), self.pkg(len(install)),
            len(upgrade), self.pkg(len(upgrade))))
        self.template(78)
        for installed, upgraded in itertools.izip_longest(install, upgrade):
            if upgraded:
                print("| Package {0} upgraded successfully".format(upgraded))
            if installed:
                print("| Package {0} installed successfully".format(installed))
        self.template(78)
        print("")