def deflate_and_base64_encode(string_val):
 return base64.b64encode(zlib.compress(string_val)[2:(-4)])

def deflate_and_base64_encode ( string_val ) : return base64 . b64encode ( zlib . compress ( string_val ) [ 2 : ( - 4 ) ] )
deflates and the base64 encodes a string .