code: def _is_delta_table(table_name: str) -> bool:
      """Checks if a Delta table exists with the specified table name.
  
      Returns:
          True if a Delta table exists with the specified table name. False otherwise.
  
      """
      from pyspark.sql import SparkSession
      from pyspark.sql.utils import AnalysisException
  
      spark = SparkSession.builder.getOrCreate()
  
      try:
          # use DESCRIBE DETAIL to check if the table is a Delta table
          # https://docs.databricks.com/delta/delta-utility.html#describe-detail
          # format will be `delta` for delta tables
          spark.sql(f"DESCRIBE DETAIL {table_name}").filter(
              "format = 'delta'"
          ).count()
          return True
      except AnalysisException:
          return False
  
imports: import logging
  import os
  from typing import Optional
label_desc: Use image node_id 1 for calling a global function with example usage: _is_delta_table(table_name) and returns: True, False