def translate_table(metadata, raw_table):
    """Converts a case-insensitive table name to a case-sensitive str.

    :param metadata: Reflected SQLAlchemy MetaData object.
    :type metadata: MetaData
    :param raw_table: Case-insensitive table name.
    :type_table: str
    :returns: Case-sensitive table name.
    :rtype: str
    """
    for table in metadata.tables.keys():
        if table.lower() == raw_table.lower():
            return table
    raise ValueError(
        f"Table '{raw_table}' requested to be filtered is not in selected database."
        )
