def try_lock(self, key, lease_time=-<NUM_LIT:1>, timeout=-<NUM_LIT:1>):
check_not_none(key, "<STR_LIT>")<EOL>key_data = self._to_data(key)<EOL>return self._encode_invoke_on_key(multi_map_try_lock_codec, key_data, key=key_data,<EOL>thread_id=thread_id(), lease=to_millis(lease_time),<EOL>timeout=to_millis(timeout),<EOL>reference_id=self.reference_id_generator.get_and_increment())<EOL>
Tries to acquire the lock for the specified key. When the lock is not available,

    * If timeout is not provided, the current thread doesn't wait and returns ``false`` immediately.
    * If a timeout is provided, the current thread becomes disabled for thread scheduling purposes and lies
      dormant until one of the followings happens:
        * the lock is acquired by the current thread, or
        * the specified waiting time elapses.

If lease_time is provided, lock will be released after this time elapses.

:param key: (object), key to lock in this map.
:param lease_time: (int), time in seconds to wait before releasing the lock (optional).
:param timeout: (int), maximum time in seconds to wait for the lock (optional).
:return: (bool), ``true`` if the lock was acquired and otherwise, false.