<s> from __future__ import absolute_import , unicode_literals <EOL> import warnings <EOL> class RemovedInWagtail16Warning ( DeprecationWarning ) : <EOL> pass <EOL> removed_in_next_version_warning = RemovedInWagtail16Warning <EOL> class RemovedInWagtail17Warning ( PendingDeprecationWarning ) : <EOL> pass <EOL> class ThisShouldBeAList ( list ) : <EOL> """<STR_LIT>""" <EOL> message = '<STR_LIT>' <EOL> def __init__ ( self , items , name , category ) : <EOL> super ( ThisShouldBeAList , self ) . __init__ ( items ) <EOL> self . name = name <EOL> self . category = category <EOL> def _format_message ( self , rhs ) : <EOL> return self . message . format ( name = self . name , type = type ( rhs ) . __name__ ) <EOL> def __add__ ( self , rhs ) : <EOL> cls = type ( self ) <EOL> if isinstance ( rhs , tuple ) : <EOL> message = self . _format_message ( rhs ) <EOL> warnings . warn ( message , category = self . category , stacklevel = <NUM_LIT:2> ) <EOL> rhs = list ( rhs ) <EOL> return cls ( super ( ThisShouldBeAList , self ) . __add__ ( list ( rhs ) ) , <EOL> name = self . name , category = self . category ) <EOL> class SearchFieldsShouldBeAList ( ThisShouldBeAList ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , items , name = '<STR_LIT>' , category = RemovedInWagtail17Warning ) : <EOL> super ( SearchFieldsShouldBeAList , self ) . __init__ ( items , name , category ) </s>
