<s> """<STR_LIT>""" <EOL> import gzip <EOL> import StringIO <EOL> import zlib <EOL> import rekall_pb2 <EOL> from grr . lib import rdfvalue <EOL> from grr . lib . rdfvalues import structs as rdf_structs <EOL> class PluginRequest ( rdf_structs . RDFProtoStruct ) : <EOL> """<STR_LIT>""" <EOL> protobuf = rekall_pb2 . PluginRequest <EOL> class RekallRequest ( rdf_structs . RDFProtoStruct ) : <EOL> """<STR_LIT>""" <EOL> protobuf = rekall_pb2 . RekallRequest <EOL> class MemoryInformation ( rdf_structs . RDFProtoStruct ) : <EOL> """<STR_LIT>""" <EOL> protobuf = rekall_pb2 . MemoryInformation <EOL> class RekallResponse ( rdf_structs . RDFProtoStruct ) : <EOL> """<STR_LIT>""" <EOL> protobuf = rekall_pb2 . RekallResponse <EOL> def SerializeToString ( self ) : <EOL> json_messages = self . Get ( "<STR_LIT>" ) <EOL> if json_messages : <EOL> self . Set ( "<STR_LIT>" , zlib . compress ( json_messages ) ) <EOL> self . Set ( "<STR_LIT>" , None ) <EOL> return super ( RekallResponse , self ) . SerializeToString ( ) <EOL> @ property <EOL> def json_messages ( self ) : <EOL> json_messages = self . Get ( "<STR_LIT>" ) <EOL> if json_messages : <EOL> return json_messages . Uncompress ( ) <EOL> json_messages = self . Get ( "<STR_LIT>" ) <EOL> if json_messages : <EOL> return json_messages <EOL> return "<STR_LIT>" <EOL> @ json_messages . setter <EOL> def json_messages ( self , value ) : <EOL> self . Set ( "<STR_LIT>" , value ) <EOL> self . Set ( "<STR_LIT>" , None ) <EOL> class ZippedJSONBytes ( rdfvalue . RDFZippedBytes ) : <EOL> """<STR_LIT>""" <EOL> class RekallProfile ( rdf_structs . RDFProtoStruct ) : <EOL> protobuf = rekall_pb2 . RekallProfile <EOL> @ property <EOL> def payload ( self ) : <EOL> if self . compression == "<STR_LIT>" : <EOL> return gzip . GzipFile ( fileobj = StringIO . StringIO ( self . data ) ) . read ( ) <EOL> return self . data </s>
