class_docstr: Google Storage Transfer Service functionalities.
  
  All methods in the hook with *project_id* in the signature must be called
  with keyword arguments rather than positional.
docstr: Check whether an operation exists with the expected status.
  
  :param operations: (Required) List of transfer operations to check.
  :param expected_statuses: (Required) The expected status. See:
      https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferOperations#Status
  :return: If there is an operation with the expected state in the
      operation list, returns true,
  :raises AirflowException: If it encounters operations with state FAILED
      or ABORTED in the list.
code: def operations_contain_expected_statuses(
      operations: list[dict], expected_statuses: set[str] | str
  ) -> bool:
      """Check whether an operation exists with the expected status.
  
      :param operations: (Required) List of transfer operations to check.
      :param expected_statuses: (Required) The expected status. See:
          https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferOperations#Status
      :return: If there is an operation with the expected state in the
          operation list, returns true,
      :raises AirflowException: If it encounters operations with state FAILED
          or ABORTED in the list.
      """
      expected_statuses_set = (
          {expected_statuses}
          if isinstance(expected_statuses, str)
          else set(expected_statuses)
      )
      if not operations:
          return False
  
      current_statuses = {
          operation[METADATA][STATUS] for operation in operations
      }
  
      if len(current_statuses - expected_statuses_set) != len(
          current_statuses
      ):
          return True
  
      if len(NEGATIVE_STATUSES - current_statuses) != len(
          NEGATIVE_STATUSES
      ):
          raise AirflowException(
              f"An unexpected operation status was encountered. "
              f"Expected: {', '.join(expected_statuses_set)}"
          )
      return False
  
imports: from __future__ import annotations
  import json
  import logging
  import time
  import warnings
  from copy import deepcopy
  from datetime import timedelta
  from typing import TYPE_CHECKING, Any, Sequence
  from google.cloud.storage_transfer_v1 import ListTransferJobsRequest, StorageTransferServiceAsyncClient, TransferJob, TransferOperation
  from googleapiclient.discovery import Resource, build
  from googleapiclient.errors import HttpError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.google.common.hooks.base_google import GoogleBaseAsyncHook, GoogleBaseHook
label_desc: Use image node_id 16 for calling the CloudDataTransferServiceHook obj's underlying member method code with example usage: obj.operations_contain_expected_statuses(operations, expected_statuses) and returns: False, False, True