class_docstr: This hook connects to a mail server by using the imap protocol.
  
  .. note:: Please call this Hook as context manager via `with`
      to automatically open and close the connection to the mail server.
  
  :param imap_conn_id: The :ref:`imap connection id <howto/connection:imap>`
      that contains the information used to authenticate the client.
docstr: Checks the mail folder for mails containing attachments with the given name.
  
  :param name: The name of the attachment that will be searched for.
  :param check_regex: Checks the name for a regular expression.
  :param mail_folder: The mail folder where to look at.
  :param mail_filter: If set other than 'All' only specific mails will be checked.
      See :py:meth:`imaplib.IMAP4.search` for details.
  :returns: True if there is an attachment with the given name and False if not.
docstr_tok: ["Checks","the","mail","folder","for","mails","containing","attachments","with","the","given","name",".",":","param","name",":","The","name","of","the","attachment","that","will","be","searched","for",".",":","param","check_regex",":","Checks","the","name","for","a","regular","expression",".",":","param","mail_folder",":","The","mail","folder","where","to","look","at",".",":","param","mail_filter",":","If","set","other","than","'All","'","only","specific","mails","will","be","checked",".","See",":","py",":","meth",":","`","imaplib.IMAP4.search","`","for","details",".",":","returns",":","True","if","there","is","an","attachment","with","the","given","name","and","False","if","not","."]
code: def has_mail_attachment(
      self,
      name: str,
      *,
      check_regex: bool = False,
      mail_folder: str = "INBOX",
      mail_filter: str = "All",
  ) -> bool:
      """
      Checks the mail folder for mails containing attachments with the given name.
  
      :param name: The name of the attachment that will be searched for.
      :param check_regex: Checks the name for a regular expression.
      :param mail_folder: The mail folder where to look at.
      :param mail_filter: If set other than 'All' only specific mails will be checked.
          See :py:meth:`imaplib.IMAP4.search` for details.
      :returns: True if there is an attachment with the given name and False if not.
      """
      mail_attachments = self._retrieve_mails_attachments_by_name(
          name, check_regex, True, mail_folder, mail_filter
      )
      return bool(mail_attachments)
  
imports: from __future__ import annotations
  import email
  import imaplib
  import os
  import re
  import ssl
  from typing import TYPE_CHECKING, Any, Iterable
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 6 for calling the ImapHook obj's underlying member method code with example usage: obj.has_mail_attachment(name) and returns: bool