def put(self, key, value, ttl=-<NUM_LIT:1>):
check_not_none(key, "<STR_LIT>")<EOL>check_not_none(value, "<STR_LIT>")<EOL>key_data = self._to_data(key)<EOL>value_data = self._to_data(value)<EOL>return self._put_internal(key_data, value_data, ttl)<EOL>
Associates the specified value with the specified key in this map. If the map previously contained a mapping for
the key, the old value is replaced by the specified value. If ttl is provided, entry will expire and get evicted
after the ttl.

**Warning:
This method returns a clone of the previous value, not the original (identically equal) value previously put
into the map.**

**Warning: This method uses __hash__ and __eq__ methods of binary form of the key, not the actual implementations
of __hash__ and __eq__ defined in key's class.**

:param key: (object), the specified key.
:param value: (object), the value to associate with the key.
:param ttl: (int), maximum time in seconds for this entry to stay, if not provided, the value configured on
    server side configuration will be used(optional).
:return: (object), previous value associated with key or ``None`` if there was no mapping for key.