def translate(root_list, use_bag_semantics=False):
    """
    Translate a list of relational algebra trees into SQL statements.

    :param root_list: a list of tree roots
    :param use_bag_semantics: flag for using relational algebra bag semantics
    :return: a list of SQL statements
    """
    translator = (Translator() if use_bag_semantics else SetTranslator())
    return [translator.translate(root).to_sql() for root in root_list]
def translate ( root_list , use_bag_semantics = False ) : translator = ( Translator ( ) if use_bag_semantics else SetTranslator ( ) ) return [ translator . translate ( root ) . to_sql ( ) for root in root_list ]
Translate a list of relational algebra trees into SQL statements.

    :param root_list: a list of tree roots
    :param use_bag_semantics: flag for using relational algebra bag semantics
    :return: a list of SQL statements