class_docstr: Response from Async Inference endpoint
  
  This response object provides a method to check for an async inference result in the
  Amazon S3 output path specified. If result object exists in that path, get and return
  the result
class_docstr_tok: ["Response","from","Async","Inference","endpoint","This","response","object","provides","a","method","to","check","for","an","async","inference","result","in","the","Amazon","S3","output","path","specified",".","If","result","object","exists","in","that","path",",","get","and","return","the","result"]
docstr: Get inference result from the output & failure Amazon S3 path
docstr_tok: ["Get","inference","result","from","the","output","&","failure","Amazon","S3","path"]
code: def _get_result_from_s3_output_failure_paths(
      self, output_path, failure_path
  ):
      """Get inference result from the output & failure Amazon S3 path"""
      bucket, key = parse_s3_url(output_path)
      try:
          response = self.predictor_async.s3_client.get_object(
              Bucket=bucket, Key=key
          )
          return self.predictor_async.predictor._handle_response(
              response
          )
      except ClientError as e:
          if e.response["Error"]["Code"] == "NoSuchKey":
              try:
                  failure_bucket, failure_key = parse_s3_url(
                      failure_path
                  )
                  failure_response = (
                      self.predictor_async.s3_client.get_object(
                          Bucket=failure_bucket, Key=failure_key
                      )
                  )
                  failure_response = (
                      self.predictor_async.predictor._handle_response(
                          failure_response
                      )
                  )
                  raise AsyncInferenceModelError(
                      message=failure_response
                  )
              except ClientError as ex:
                  if ex.response["Error"]["Code"] == "NoSuchKey":
                      raise ObjectNotExistedError(
                          message="Inference could still be running",
                          output_path=output_path,
                      )
                  raise UnexpectedClientError(
                      message=ex.response["Error"]["Message"]
                  )
          raise UnexpectedClientError(
              message=e.response["Error"]["Message"]
          )
  
file_path: sagemaker-python-sdk/src/sagemaker/async_inference/async_inference_response.py
imports: from __future__ import print_function, absolute_import
  from botocore.exceptions import ClientError
  from sagemaker.s3 import parse_s3_url
  from sagemaker.async_inference import WaiterConfig
  from sagemaker.exceptions import ObjectNotExistedError, UnexpectedClientError, AsyncInferenceModelError
label_desc: Use image node_id 5 for calling the AsyncInferenceResponse obj's underlying member method code with example usage: obj._get_result_from_s3_output_failure_paths(output_path, failure_path) and returns: self