<s> """<STR_LIT>""" <EOL> from thrift import TSerialization <EOL> from spyder . thrift . gen . ttypes import CrawlUri <EOL> class DataMessage ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message = None , identity = None , curi = None ) : <EOL> """<STR_LIT>""" <EOL> if message is not None : <EOL> self . identity = message [ <NUM_LIT:0> ] <EOL> self . serialized_curi = message [ <NUM_LIT:1> ] <EOL> self . curi = deserialize_crawl_uri ( message [ <NUM_LIT:1> ] ) <EOL> elif identity is not None or curi is not None : <EOL> self . identity = identity <EOL> self . curi = curi <EOL> else : <EOL> self . identity = self . curi = None <EOL> def serialize ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ self . identity , serialize_crawl_uri ( self . curi ) ] <EOL> def __eq__ ( self , other ) : <EOL> return ( self . identity == other . identity <EOL> and self . curi == other . curi ) <EOL> class MgmtMessage ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message = None , topic = None , identity = None , data = None ) : <EOL> """<STR_LIT>""" <EOL> if message is not None : <EOL> self . topic = message [ <NUM_LIT:0> ] <EOL> self . identity = message [ <NUM_LIT:1> ] <EOL> self . data = message [ <NUM_LIT:2> ] <EOL> elif topic is not None or identity is not None or data is not None : <EOL> self . topic = topic <EOL> self . identity = identity <EOL> self . data = data <EOL> else : <EOL> self . topic = self . identity = self . data = None <EOL> def serialize ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ self . topic , self . identity , self . data ] <EOL> def __eq__ ( self , other ) : <EOL> return ( self . topic == other . topic <EOL> and self . identity == other . identity <EOL> and self . data == other . data ) <EOL> def deserialize_crawl_uri ( serialized ) : <EOL> """<STR_LIT>""" <EOL> return TSerialization . deserialize ( CrawlUri ( ) , serialized ) <EOL> def serialize_crawl_uri ( crawl_uri ) : <EOL> """<STR_LIT>""" <EOL> return TSerialization . serialize ( crawl_uri ) </s>
