def put(self, key, value, ttl=<NUM_LIT:0>):
check_not_none(key, "<STR_LIT>")<EOL>check_not_none(key, "<STR_LIT>")<EOL>key_data = self._to_data(key)<EOL>value_data = self._to_data(value)<EOL>return self._encode_invoke_on_key(replicated_map_put_codec, key_data, key=key_data, value=value_data,<EOL>ttl=to_millis(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.

: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.