class_docstr: Poll the EMR notebook until it reaches any of the target states; raise AirflowException on failure.
  
  .. seealso::
      For more information on how to use this sensor, take a look at the guide:
      :ref:`howto/sensor:EmrNotebookExecutionSensor`
  
  :param notebook_execution_id: Unique id of the notebook execution to be poked.
  :target_states: the states the sensor will wait for the execution to reach.
      Default target_states is ``FINISHED``.
  :failed_states: if the execution reaches any of the failed_states, the sensor will fail.
      Default failed_states is ``FAILED``.
class_docstr_tok: ["Poll","the","EMR","notebook","until","it","reaches","any","of","the","target","states",";","raise","AirflowException","on","failure",".","..","seealso",":",":","For","more","information","on","how","to","use","this","sensor",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/sensor",":","EmrNotebookExecutionSensor","`",":","param","notebook_execution_id",":","Unique","id","of","the","notebook","execution","to","be","poked",".",":","target_states",":","the","states","the","sensor","will","wait","for","the","execution","to","reach",".","Default","target_states","is","``","FINISHED","``",".",":","failed_states",":","if","the","execution","reaches","any","of","the","failed_states",",","the","sensor","will","fail",".","Default","failed_states","is","``","FAILED","``","."]
docstr: Get failure message from response dictionary.
  
  :param response: response from AWS API
  :return: failure message
code: def failure_message_from_response(
      response: dict[str, Any]
  ) -> str | None:
      """
      Get failure message from response dictionary.
  
      :param response: response from AWS API
      :return: failure message
      """
      cluster_status = response["NotebookExecution"]
      return cluster_status.get("LastStateChangeReason", None)
  
imports: from __future__ import annotations
  from datetime import timedelta
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Iterable, Sequence
  from deprecated import deprecated
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning, AirflowSkipException
  from airflow.providers.amazon.aws.hooks.emr import EmrContainerHook, EmrHook, EmrServerlessHook
  from airflow.providers.amazon.aws.links.emr import EmrClusterLink, EmrLogsLink, get_log_uri
  from airflow.providers.amazon.aws.triggers.emr import EmrContainerTrigger, EmrStepSensorTrigger, EmrTerminateJobFlowTrigger
  from airflow.sensors.base import BaseSensorOperator
label_desc: Use image node_id 4 for calling the EmrNotebookExecutionSensor obj's underlying member method code with example usage: obj.failure_message_from_response(response) and returns: cluster_status