<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_class_methods(*class_method_names):
 """Return a test function that, when given a class, returns ``True`` if that class has all of the class methods in ``class_method_names``. If an object is passed to the test function, check for the class methods on its class. """


    def test(cls):
        if not isinstance(cls, type):
            cls = type(cls)
        for class_method_name in class_method_names:
            try:
                class_method = getattr(cls, class_method_name)
                if class_method.__self__ is not cls:
                    return False
            except AttributeError:
                return False
        return True

    return test