def failed(self):
    'Returns :const:`True` if the task failed.'
    return (self.state == states.FAILURE)
Returns :const:`True` if the task failed.
def failed(self):
    
    return (self.state == states.FAILURE)