class_docstr: Class representing a reference to a SageMaker job result.
  
  Reference to the SageMaker job created as a result of the remote function run. The job may
  or may not have finished running.
class_docstr_tok: ["Class","representing","a","reference","to","a","SageMaker","job","result",".","Reference","to","the","SageMaker","job","created","as","a","result","of","the","remote","function","run",".","The","job","may","or","may","not","have","finished","running","."]
docstr: Returns the SageMaker job result.
  
  This method waits for the SageMaker job created from the remote function execution to
  complete for up to the timeout value (if specified). If timeout is ``None``,
  this method will wait until the SageMaker job completes.
  
  Args:
      timeout (float): Timeout in seconds to wait until the job is completed. ``None`` by
        default.
  
  Returns:
      The Python object returned by the remote function.
docstr_tok: ["Returns","the","SageMaker","job","result",".","This","method","waits","for","the","SageMaker","job","created","from","the","remote","function","execution","to","complete","for","up","to","the","timeout","value","(","if","specified",")",".","If","timeout","is","``","None","``",",","this","method","will","wait","until","the","SageMaker","job","completes",".","Args",":","timeout","(","float",")",":","Timeout","in","seconds","to","wait","until","the","job","is","completed",".","``","None","``","by","default",".","Returns",":","The","Python","object","returned","by","the","remote","function","."]
code: def result(self, timeout: float = None) -> Any:
      """Returns the SageMaker job result.
  
      This method waits for the SageMaker job created from the remote function execution to
      complete for up to the timeout value (if specified). If timeout is ``None``,
      this method will wait until the SageMaker job completes.
  
      Args:
          timeout (float): Timeout in seconds to wait until the job is completed. ``None`` by
            default.
  
      Returns:
          The Python object returned by the remote function.
      """
      try:
          self.wait(timeout)
      except UnexpectedStatusException:
          pass
  
      with self._condition:
          if self._state == _PENDING:
              raise RuntimeError()
  
          if self._state == _RUNNING:
              if (
                  self._job.describe()["TrainingJobStatus"]
                  == "Completed"
              ):
                  self._return = serialization.deserialize_obj_from_s3(
                      sagemaker_session=self._job.sagemaker_session,
                      s3_uri=s3_path_join(
                          self._job.s3_uri, RESULTS_FOLDER
                      ),
                      hmac_key=self._job.hmac_key,
                  )
                  self._state = _FINISHED
                  return self._return
              if self._job.describe()["TrainingJobStatus"] == "Failed":
                  try:
                      self._exception = serialization.deserialize_exception_from_s3(
                          sagemaker_session=self._job.sagemaker_session,
                          s3_uri=s3_path_join(
                              self._job.s3_uri, EXCEPTION_FOLDER
                          ),
                          hmac_key=self._job.hmac_key,
                      )
                  except ServiceError as serr:
                      chained_e = serr.__cause__
                      if (
                          isinstance(chained_e, ClientError)
                          and chained_e.response["Error"][
                              "Code"
                          ]  # pylint: disable=no-member
                          == "404"
                          and chained_e.response["Error"][
                              "Message"
                          ]  # pylint: disable=no-member
                          == "Not Found"
                      ):
                          if (
                              "FailureReason" in self._job.describe()
                              and self._job.describe()["FailureReason"]
                              and "RuntimeEnvironmentError: "
                              in self._job.describe()["FailureReason"]
                          ):
                              failure_msg = self._job.describe()[
                                  "FailureReason"
                              ].replace("RuntimeEnvironmentError: ", "")
                              self._exception = RuntimeEnvironmentError(
                                  failure_msg
                              )
                          else:
                              self._exception = RemoteFunctionError(
                                  "Failed to execute remote function. "
                                  + "Check corresponding job for details."
                              )
                      else:
                          self._exception = serr
                  self._state = _FINISHED
              elif (
                  self._job.describe()["TrainingJobStatus"] == "Stopped"
              ):
                  self._state = _CANCELLED
                  raise RemoteFunctionError(
                      "Job for remote function has been aborted."
                  )
              else:
                  raise TimeoutError(
                      "Job for remote function timed out before reaching a termination status."
                  )
  
          if self._state == _FINISHED:
              if self._exception:
                  raise self._exception
              return self._return
  
          return None
  
imports: from __future__ import absolute_import
  from concurrent.futures import ThreadPoolExecutor
  from collections import deque
  import time
  import threading
  from typing import Callable, Dict, List, Optional, Tuple, Any, Union
  import functools
  import itertools
  import inspect
  from botocore.exceptions import ClientError
  from sagemaker.exceptions import UnexpectedStatusException
  from sagemaker.experiments._run_context import _RunContext
  import sagemaker.remote_function.core.serialization
  from sagemaker.remote_function.errors import RemoteFunctionError, ServiceError, DeserializationError
  from sagemaker.remote_function.core.stored_function import RESULTS_FOLDER, EXCEPTION_FOLDER
  from sagemaker.remote_function.runtime_environment.runtime_environment_manager import RuntimeEnvironmentError
  from sagemaker.session import Session
  from sagemaker.s3 import s3_path_join
  from sagemaker.remote_function.job import _JobSettings, _Job, _RunInfo
  from sagemaker.remote_function import logging_config
  from sagemaker.utils import name_from_base, base_from_name
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter
label_desc: Use image node_id 4 for calling the Future obj's underlying member method code with example usage: obj.result(timeout) and returns: None, self, self