<s> from sqlalchemy . schema import ColumnCollectionConstraint <EOL> from sqlalchemy . sql import expression <EOL> class ExcludeConstraint ( ColumnCollectionConstraint ) : <EOL> """<STR_LIT>""" <EOL> __visit_name__ = '<STR_LIT>' <EOL> where = None <EOL> def __init__ ( self , * elements , ** kw ) : <EOL> """<STR_LIT>""" <EOL> ColumnCollectionConstraint . __init__ ( <EOL> self , <EOL> * [ col for col , op in elements ] , <EOL> name = kw . get ( '<STR_LIT:name>' ) , <EOL> deferrable = kw . get ( '<STR_LIT>' ) , <EOL> initially = kw . get ( '<STR_LIT>' ) <EOL> ) <EOL> self . operators = { } <EOL> for col_or_string , op in elements : <EOL> name = getattr ( col_or_string , '<STR_LIT:name>' , col_or_string ) <EOL> self . operators [ name ] = op <EOL> self . using = kw . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> where = kw . get ( '<STR_LIT>' ) <EOL> if where : <EOL> self . where = expression . _literal_as_text ( where ) <EOL> def copy ( self , ** kw ) : <EOL> elements = [ ( col , self . operators [ col ] ) <EOL> for col in self . columns . keys ( ) ] <EOL> c = self . __class__ ( * elements , <EOL> name = self . name , <EOL> deferrable = self . deferrable , <EOL> initially = self . initially ) <EOL> c . dispatch . _update ( self . dispatch ) <EOL> return c </s>
