def cancel_upload(self, canceller=None, args=None, kwargs=None):
        with self._lock:
            # An easy way to think of this is the case where we want to abort
            # any multipart uploads that have been started but not completed.
            # There are two states that correspond to not being in progress:
            # _UNSTARTED and _COMPLETED.  The reason _CANCELLED is not
            # considered is because a part task can cancel an upload, yet does
            # not have enough context to be able to abort the upload (other
            # tasks may be executing upload parts).
            if self._state not in [self._UNSTARTED, self._COMPLETED] and \
                    canceller is not None:
                if args is None:
                    args = ()
                if kwargs is None:
                    kwargs = {}
                canceller(self._upload_id, *args, **kwargs)
            self._state = self._CANCELLED
Cancel the upload.
dataset/ETHPy150Open aws/aws-cli/awscli/customizations/s3/tasks.py/MultipartUploadContext.cancel_upload