def from_bytes(klass, data):
 obj = klass()
 b = TMemoryBuffer(data)
 p = TBinaryProtocol(b)
 obj.read(p)
 return obj

def from_bytes ( klass , data ) : obj = klass ( ) b = TMemoryBuffer ( data ) p = TBinaryProtocol ( b ) obj . read ( p ) return obj
returns thrift object from a string .