def connect(self, database_path, mode="a"):
        """
        :param str database_path:
            Path to the SQLite database file to be connected.
        :param str mode:
            ``"r"``: Open for read only.
            ``"w"``: Open for read/write.
            Delete existing tables when connecting.
            ``"a"``: Open for read/write. Append to the existing tables.
        :raises ValueError:
            If ``database_path`` is invalid or |attr_mode| is invalid.
        :raises sqlite3.OperationalError: If unable to open the database file.
        """

        self.close()

        if mode == "r":
            self.__verify_sqlite_db_file(database_path)
        elif ["w", "a"] in mode:
            self.__validate_db_path(database_path)
        else:
            raise ValueError("unknown connection mode: " + mode)

        if database_path == simplesqlite.MEMORY_DB_NAME:
            self.__database_path = database_path
        else:
            self.__database_path = os.path.realpath(database_path)

        self.__connection = sqlite3.connect(database_path)
        self.__mode = mode

        if mode != "w":
            return

        for table in self.get_table_name_list():
            self.drop_table(table)
dataset/ETHPy150Open thombashi/SimpleSQLite/simplesqlite/core.py/SimpleSQLite.connect/swapped operands of `in`