PyFunceble/database.py
def is_in_database(self):
        """
        Check if the element is into the database.
        """

        if (
            self._authorization()
            and PyFunceble.INTERN["file_to_test"] in PyFunceble.INTERN["whois_db"]
            and PyFunceble.INTERN["to_test"]
            in PyFunceble.INTERN["whois_db"][PyFunceble.INTERN["file_to_test"]]
        ):
            # * We are authorized to work.
            # and
            # * The given file path exist in the database.
            # and
            # * The element we are testing is in the database related to the
            # given file path.

            # We return True, the element we are testing is into the database.
            return True

        # * We are not authorized to work.
        # or
        # * The given file path does not exist in the database.
        # or
        # * The element we are testing is not in the database related to the
        # given file path.

        # We return False,the element we are testing is not into the database.
        return False
def is_in_database(self):
        """
        Check if the element is into the database.
        """

        if (
            self._authorization()
            and PyFunceble.INTERN["file_to_test"] in PyFunceble.INTERN["whois_db"]
            and PyFunceble.INTERN["to_test"]
            in PyFunceble.INTERN["whois_db"][PyFunceble.INTERN["file_to_test"]]
        ):
            # * We are authorized to work.
            # and
            # * The given file path exist in the database.
            # and
            # * The element we are testing is in the database related to the
            # given file path.

            # We return True, the element we are testing is into the database.
            return True

        # * We are not authorized to work.
        # or
        # * The given file path does not exist in the database.
        # or
        # * The element we are testing is not in the database related to the
        # given file path.

        # We return False,the element we are testing is not into the database.
        return False
Check if the element is into the database.