def increment(self, settings, request, response=None, error=None):
        """Increment the retry counters.

        :param Optional[Dict[str, Any]] settings: The configurable values pertaining to the increment operation.
        :param "PipelineRequest" request: A pipeline request object.
        :param "PipelineResponse": A pipeline response object.
        :param error: An error encountered during the request, or
            None if the response was received successfully.
        :paramtype error: Union[ServiceRequestError, ServiceResponseError]
        :returns: Whether the retry attempts are exhausted.
        :rtype: bool
        """
        settings['total'] -= 1

        if error and isinstance(error, ServiceRequestError):
            # Errors when we're fairly sure that the server did not receive the
            # request, so it should be safe to retry.
            settings['connect'] -= 1
            settings['history'].append(RequestHistory(request, error=error))

        elif error and isinstance(error, ServiceResponseError):
            # Errors that occur after the request has been started, so we should
            # assume that the server began processing it.
            settings['read'] -= 1
            settings['history'].append(RequestHistory(request, error=error))

        else:
            # Incrementing because of a server error like a 500 in
            # status_forcelist and a the given method is in the allowlist
            if response:
                settings['status'] -= 1
                settings['history'].append(RequestHistory(request, http_response=response))

        if not is_exhausted(settings):
            if request.method not in ['PUT'] and settings['retry_secondary']:
                self._set_next_host_location(settings, request)

            # rewind the request body if it is a stream
            if request.body and hasattr(request.body, 'read'):
                # no position was saved, then retry would not work
                if settings['body_position'] is None:
                    return False
                try:
                    # attempt to rewind the body to the initial position
                    request.body.seek(settings['body_position'], SEEK_SET)
                except (UnsupportedOperation, ValueError):
                    # if body is not seekable, then retry would not work
                    return False
            settings['count'] += 1
            return True
        return False
Increment the retry counters.

        :param Optional[Dict[str, Any]] settings: The configurable values pertaining to the increment operation.
        :param "PipelineRequest" request: A pipeline request object.
        :param "PipelineResponse": A pipeline response object.
        :param error: An error encountered during the request, or
            None if the response was received successfully.
        :paramtype error: Union[ServiceRequestError, ServiceResponseError]
        :returns: Whether the retry attempts are exhausted.
        :rtype: bool
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/storage/blob/_shared/policies.py