def increment(
        self,
        settings: Dict[str, Any],
        response: Optional[
            Union[PipelineRequest[HTTPRequestType], PipelineResponse[HTTPRequestType, AllHttpResponseType]]
        ] = None,
        error: Optional[Exception] = None,
    ) -> bool:
        """Increment the retry counters.

        :param settings: The retry settings.
        :type settings: dict
        :param response: A pipeline response object.
        :type response: ~azure.core.pipeline.PipelineResponse
        :param error: An error encountered during the request, or
         None if the response was received successfully.
        :type error: ~azure.core.exceptions.AzureError
        :return: Whether any retry attempt is available
         True if more retry attempts available, False otherwise
        :rtype: bool
        """
        # FIXME This code is not None safe: https://github.com/Azure/azure-sdk-for-python/issues/31528
        response = cast(
            Union[PipelineRequest[HTTPRequestType], PipelineResponse[HTTPRequestType, AllHttpResponseType]], response
        )

        settings["total"] -= 1

        if isinstance(response, PipelineResponse) and response.http_response.status_code == 202:
            return False

        if error and self._is_connection_error(error):
            # Connect retry?
            settings["connect"] -= 1
            settings["history"].append(RequestHistory(response.http_request, error=error))

        elif error and self._is_read_error(error):
            # Read retry?
            settings["read"] -= 1
            if hasattr(response, "http_request"):
                settings["history"].append(RequestHistory(response.http_request, error=error))

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

        if self.is_exhausted(settings):
            return False

        if response.http_request.body and hasattr(response.http_request.body, "read"):
            if "body_position" not in settings:
                return False
            try:
                # attempt to rewind the body to the initial position
                # If it has "read", it has "seek", so casting for mypy
                cast(IO[bytes], response.http_request.body).seek(settings["body_position"], SEEK_SET)
            except (UnsupportedOperation, ValueError, AttributeError):
                # if body is not seekable, then retry would not work
                return False
        file_positions = settings.get("file_positions")
        if response.http_request.files and file_positions:
            try:
                for value in response.http_request.files.values():
                    file_name, body = value[0], value[1]
                    if file_name in file_positions:
                        position = file_positions[file_name]
                        body.seek(position, SEEK_SET)
            except (UnsupportedOperation, ValueError, AttributeError):
                # if body is not seekable, then retry would not work
                return False
        return True
Increment the retry counters.

        :param settings: The retry settings.
        :type settings: dict
        :param response: A pipeline response object.
        :type response: ~azure.core.pipeline.PipelineResponse
        :param error: An error encountered during the request, or
         None if the response was received successfully.
        :type error: ~azure.core.exceptions.AzureError
        :return: Whether any retry attempt is available
         True if more retry attempts available, False otherwise
        :rtype: bool
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/core/pipeline/policies/_retry.py