<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def callbacks(cls):
        '''Return all the methods that are actually a request callback.'''
        if cls.__callbacks is not None:
            return cls.__callbacks
        cls.__callbacks = []
        for mname in dir(cls):
            # Avoid recursion by excluding all methods of this prototype class
            if mname in dir(Resource):
                continue
            callback = getattr(cls, mname)
            if not hasattr(callback, 'swagger_ops'):
                continue
            cls.__callbacks.append(callback)
        return cls.__callbacks