parameters: (data, key)
return_statement: return tob('!') + sig + tob('?') + msg
docstring: Encode and sign a pickle-able object. Return a (byte) string
docstring_summary: Encode and sign a pickle-able object. Return a (byte) string
docstring_tokens: Encode and sign a pickle - able object . Return a ( byte ) string
function: def cookie_encode(data, key):
      ''' Encode and sign a pickle-able object. Return a (byte) string '''
      msg = base64.b64encode(pickle.dumps(data, -1))
      sig = base64.b64encode(hmac.new(key, msg).digest())
      return tob('!') + sig + tob('?') + msg
function_tokens: def cookie_encode ( data , key ) : msg = base64 . b64encode ( pickle . dumps ( data , - 1 ) ) sig = base64 . b64encode ( hmac . new ( key , msg ) . digest ( ) ) return tob ( '!' ) + sig + tob ( '?' ) + msg