@classmethod
    def to_table_str(cls, name):
        """
        :param str name: Table name.
        :return: String that suitable for table name of a SQLite query.
        :rtype: str

        :Examples:

            >>> from simplesqlite.sqlquery import SqlQuery
            >>> SqlQuery.to_table_str("length")
            'length'
            >>> SqlQuery.to_table_str("length(cm)")
            '[length(cm)]'
            >>> SqlQuery.to_table_str("string length")
            "'string length'"
        """

        if cls.__RE_TABLE_STR.search(name):
            return "[%s]" % (name)

        if cls.__RE_SPACE.search(name):
            return "'%s'" % (name)

        return name
dataset/ETHPy150Open thombashi/SimpleSQLite/simplesqlite/sqlquery.py/SqlQuery.to_table_str/original