Repository: apache/airflow
File: providers/imap/src/airflow/providers/imap/hooks/imap.py (Python)

Code before:
        :returns: True if there is an attachment with the given name and False if not.
        """
        with self:
            mail_attachments = self._retrieve_mails_attachments_by_name(
                name, check_regex, True, max_mails, mail_folder, mail_filter
            )
            return bool(mail_attachments)

    def retrieve_mail_attachments(
        self,
        name: str,
        *,
        check_regex: bool = False,
        latest_only: bool = False,
        max_mails: int | None = None,
        mail_folder: str = "INBOX",
        mail_filter: str = "All",
        not_found_mode: str = "raise",
    ) -> list[tuple]:
        """
        Retrieve mail's attachments in the mail folder by its name.

        :param name: The name of the attachment that will be downloaded.
        :param check_regex: Checks the name for a regular expression.
        :param latest_only: If set to True it will only retrieve the first matched attachment.
        :param max_mails: Maximum number of latest emails to process. Must be a positive integer. Defaults to None.
        :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.
        :param not_found_mode: Specify what should happen if no attachment has been found.
            Supported values are 'raise', 'warn' and 'ignore'.
            If it is set to 'raise' it will raise an exception,
            if set to 'warn' it will only print a warning and
            if set to 'ignore' it won't notify you at all.
        :returns: a list of tuple each containing the attachment filename and its payload.
        """
        with self:
            mail_attachments = self._retrieve_mails_attachments_by_name(
                name, check_regex, latest_only, max_mails, mail_folder, mail_filter
            )

        if not mail_attachments:
            self._handle_not_found_mode(not_found_mode)

        return mail_attachments

    def download_mail_attachments(
        self,
        name: str,
        local_output_directory: str,
        *,

Review comment (suggestion):
```suggestion
        :param max_mails: Maximum number of latest emails to process. Must be a positive integer, or None when unlimited. Defaults to None.
```

Code after:
        :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, max_mails, mail_folder, mail_filter
        )
        return bool(mail_attachments)

    def retrieve_mail_attachments(
        self,
        name: str,
        *,
        check_regex: bool = False,
        latest_only: bool = False,
        max_mails: int | None = None,
        mail_folder: str = "INBOX",
        mail_filter: str = "All",
        not_found_mode: str = "raise",
    ) -> list[tuple]:
        """
        Retrieve mail's attachments in the mail folder by its name.

        :param name: The name of the attachment that will be downloaded.
        :param check_regex: Checks the name for a regular expression.
        :param latest_only: If set to True it will only retrieve the first matched attachment.
        :param max_mails: Maximum number of latest emails to process. Must be a positive integer, or None when unlimited. Defaults to None.
        :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.
        :param not_found_mode: Specify what should happen if no attachment has been found.
            Supported values are 'raise', 'warn' and 'ignore'.
            If it is set to 'raise' it will raise an exception,
            if set to 'warn' it will only print a warning and
            if set to 'ignore' it won't notify you at all.
        :returns: a list of tuple each containing the attachment filename and its payload.
        """
        mail_attachments = self._retrieve_mails_attachments_by_name(
            name, check_regex, latest_only, max_mails, mail_folder, mail_filter
        )

        if not mail_attachments:
            self._handle_not_found_mode(not_found_mode)

        return mail_attachments

    def download_mail_attachments(
        self,
        name: str,
        local_output_directory: str,
        *,
        check_regex: bool = False,
        latest_only: bool = False,