<s> import six <EOL> from cassandra . cqlengine import UnicodeMixin <EOL> class QueryOperatorException ( Exception ) : <EOL> pass <EOL> class BaseQueryOperator ( UnicodeMixin ) : <EOL> symbol = None <EOL> cql_symbol = None <EOL> def __unicode__ ( self ) : <EOL> if self . cql_symbol is None : <EOL> raise QueryOperatorException ( "<STR_LIT>" ) <EOL> return self . cql_symbol <EOL> class OpMapMeta ( type ) : <EOL> def __init__ ( cls , name , bases , dct ) : <EOL> if not hasattr ( cls , '<STR_LIT>' ) : <EOL> cls . opmap = { } <EOL> else : <EOL> cls . opmap [ cls . symbol ] = cls <EOL> super ( OpMapMeta , cls ) . __init__ ( name , bases , dct ) <EOL> @ six . add_metaclass ( OpMapMeta ) <EOL> class BaseWhereOperator ( BaseQueryOperator ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def get_operator ( cls , symbol ) : <EOL> try : <EOL> return cls . opmap [ symbol . upper ( ) ] <EOL> except KeyError : <EOL> raise QueryOperatorException ( "<STR_LIT>" . format ( symbol ) ) <EOL> class EqualsOperator ( BaseWhereOperator ) : <EOL> symbol = '<STR_LIT>' <EOL> cql_symbol = '<STR_LIT:=>' <EOL> class NotEqualsOperator ( BaseWhereOperator ) : <EOL> symbol = '<STR_LIT>' <EOL> cql_symbol = '<STR_LIT>' <EOL> class InOperator ( EqualsOperator ) : <EOL> symbol = '<STR_LIT>' <EOL> cql_symbol = '<STR_LIT>' <EOL> class GreaterThanOperator ( BaseWhereOperator ) : <EOL> symbol = "<STR_LIT>" <EOL> cql_symbol = '<STR_LIT:>>' <EOL> class GreaterThanOrEqualOperator ( BaseWhereOperator ) : <EOL> symbol = "<STR_LIT>" <EOL> cql_symbol = '<STR_LIT>' <EOL> class LessThanOperator ( BaseWhereOperator ) : <EOL> symbol = "<STR_LIT>" <EOL> cql_symbol = '<STR_LIT:<>' <EOL> class LessThanOrEqualOperator ( BaseWhereOperator ) : <EOL> symbol = "<STR_LIT>" <EOL> cql_symbol = '<STR_LIT>' <EOL> class ContainsOperator ( EqualsOperator ) : <EOL> symbol = "<STR_LIT>" <EOL> cql_symbol = '<STR_LIT>' </s>
