def cancel(self):
        if not self.called:
            canceller = self._canceller
            if canceller:
                canceller(self)
            else:
                # Arrange to eat the callback that will eventually be fired
                # since there was no real canceller.
                self._suppressAlreadyCalled = True
            if not self.called:
                # There was no canceller, or the canceller didn't call
                # callback or errback.
                self.errback(failure.Failure(CancelledError()))
        elif isinstance(self.result, Deferred):
            # Waiting for another deferred -- cancel it instead.
            self.result.cancel()
insert current project root path into sys path
dataset/ETHPy150Open twisted/twisted/twisted/internet/defer.py/Deferred.cancel--crossover with--dataset/ETHPy150Open wecatch/app-turbo/turbo/register.py/register_app