def encode(self, obj):
if self._is_valid_mysql_bigint(obj):<EOL><INDENT>return obj, '<STR_LIT:i>'<EOL><DEDENT>value = pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)<EOL>value_type = '<STR_LIT:p>'<EOL>if (<EOL>self._compress_min_length<EOL>and len(value) >= self._compress_min_length<EOL>):<EOL><INDENT>value = zlib.compress(value, self._compress_level)<EOL>value_type = '<STR_LIT:z>'<EOL><DEDENT>return value, value_type<EOL>
Take a Python object and return it as a tuple (value, value_type), a
blob and a one-char code for what type it is