@classmethod
def _fix_function(cls, fn):
    """
        Ensure fn is a classmethod or staticmethod.
        """
    if not isinstance(fn, (classmethod, staticmethod)):
        return classmethod(fn)
    return fn
