class_docstr: Poll the state of the Batch environment until it reaches a terminal state; fails if the environment fails.
  
  .. seealso::
      For more information on how to use this sensor, take a look at the guide:
      :ref:`howto/sensor:BatchComputeEnvironmentSensor`
  
  :param compute_environment: Batch compute environment name
  
  :param aws_conn_id: aws connection to use, defaults to 'aws_default'
  
  :param region_name: aws region name associated with the client
class_docstr_tok: ["Poll","the","state","of","the","Batch","environment","until","it","reaches","a","terminal","state",";","fails","if","the","environment","fails",".","..","seealso",":",":","For","more","information","on","how","to","use","this","sensor",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/sensor",":","BatchComputeEnvironmentSensor","`",":","param","compute_environment",":","Batch","compute","environment","name",":","param","aws_conn_id",":","aws","connection","to","use",",","defaults","to","'aws_default'",":","param","region_name",":","aws","region","name","associated","with","the","client"]
code: def poke(self, context: Context) -> bool:
      response = self.hook.client.describe_compute_environments(  # type: ignore[union-attr]
          computeEnvironments=[self.compute_environment]
      )
  
      if not response["computeEnvironments"]:
          message = f"AWS Batch compute environment {self.compute_environment} not found"
          # TODO: remove this if block when min_airflow_version is set to higher than 2.7.1
          if self.soft_fail:
              raise AirflowSkipException(message)
          raise AirflowException(message)
  
      status = response["computeEnvironments"][0]["status"]
  
      if status in BatchClientHook.COMPUTE_ENVIRONMENT_TERMINAL_STATUS:
          return True
  
      if (
          status
          in BatchClientHook.COMPUTE_ENVIRONMENT_INTERMEDIATE_STATUS
      ):
          return False
  
      # TODO: remove this if block when min_airflow_version is set to higher than 2.7.1
      message = f"AWS Batch compute environment failed. AWS Batch compute environment status: {status}"
      if self.soft_fail:
          raise AirflowSkipException(message)
      raise AirflowException(message)
  
imports: from __future__ import annotations
  from datetime import timedelta
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Sequence
  from deprecated import deprecated
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning, AirflowSkipException
  from airflow.providers.amazon.aws.hooks.batch_client import BatchClientHook
  from airflow.providers.amazon.aws.triggers.batch import BatchJobTrigger
  from airflow.sensors.base import BaseSensorOperator
label_desc: Use image node_id 3 for calling the BatchComputeEnvironmentSensor obj's underlying member method code with example usage: obj.poke(context) and returns: True, False