<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _prefer_package(self, package):
 """ Prefer a serializtion handler over other handlers. :param str package: The name of the package to use :raises ValueError: When the given package name is not one of the available supported serializtion packages for this handler :return: The name of the serialization handler :rtype: str """


        if isinstance(package, str) and package != self.imported:
            if package not in self.packages:
                raise ValueError(
                    f"preferred package {package!r} does not exist, allowed are "
                    f"{self.packages!r}"
                )
            # clear out current serialization handler (if exists)
            if hasattr(self, "_handler"):
                del self._handler
            # manually update imported handlers with a given preference
            self._imported = self._discover_import(prefer=package)
            return package
        return self.imported