class_docstr: Interacts with Azure CosmosDB.
  
  login should be the endpoint uri, password should be the master key
  optionally, you can use the following extras to default these values
  {"database_name": "<DATABASE_NAME>", "collection_name": "COLLECTION_NAME"}.
  
  :param azure_cosmos_conn_id: Reference to the
      :ref:`Azure CosmosDB connection<howto/connection:azure_cosmos>`.
class_docstr_tok: ["Interacts","with","Azure","CosmosDB",".","login","should","be","the","endpoint","uri",",","password","should","be","the","master","key","optionally",",","you","can","use","the","following","extras","to","default","these","values","{","``","database_name","''",":","``","<","DATABASE_NAME",">","''",",","``","collection_name","''",":","``","COLLECTION_NAME","''","}",".",":","param","azure_cosmos_conn_id",":","Reference","to","the",":","ref",":","`","Azure","CosmosDB","connection","<","howto\/connection",":","azure_cosmos",">","`","."]
docstr: Checks if a collection exists in CosmosDB.
docstr_tok: ["Checks","if","a","collection","exists","in","CosmosDB","."]
code: def does_collection_exist(
      self, collection_name: str, database_name: str
  ) -> bool:
      """Checks if a collection exists in CosmosDB."""
      if collection_name is None:
          raise AirflowBadRequest("Collection name cannot be None.")
  
      # The ignores below is due to typing bug in azure-cosmos 9.2.0
      # https://github.com/Azure/azure-sdk-for-python/issues/31811
      existing_container = list(
          self.get_conn()
          .get_database_client(self.__get_database_name(database_name))
          .query_containers(
              "SELECT * FROM r WHERE r.id=@id",
              parameters=[{"name": "@id", "value": collection_name}],  # type: ignore[list-item]
          )
      )
      if not existing_container:
          return False
  
      return True
  
imports: from __future__ import annotations
  import uuid
  from typing import Any
  from urllib.parse import urlparse
  from azure.cosmos.cosmos_client import CosmosClient
  from azure.cosmos.exceptions import CosmosHttpResponseError
  from azure.mgmt.cosmosdb import CosmosDBManagementClient
  from airflow.exceptions import AirflowBadRequest, AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.providers.microsoft.azure.utils import add_managed_identity_connection_widgets, get_field, get_sync_default_azure_credential
label_desc: Use image node_id 8 for calling the AzureCosmosDBHook obj's underlying member method code with example usage: obj.does_collection_exist(collection_name, database_name) and returns: True, False