<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tag(self, sbo):
 """Tag with color green if package already installed, color yellow for packages to upgrade and color red if not installed. """

        # split sbo name with version and get name
        sbo_name = "-".join(sbo.split("-")[:-1])
        find = GetFromInstalled(sbo_name).name()
        if find_package(sbo, self.meta.pkg_path):
            paint = self.meta.color["GREEN"]
            self.count_ins += 1
            if "--rebuild" in self.flag:
                self.count_upg += 1
        elif sbo_name == find:
            paint = self.meta.color["YELLOW"]
            self.count_upg += 1
        else:
            paint = self.meta.color["RED"]
            self.count_uni += 1
        return paint