def try_lock(self, timeout=<NUM_LIT:0>, lease_time=-<NUM_LIT:1>):
return self._encode_invoke(lock_try_lock_codec, invocation_timeout=MAX_SIZE, lease=to_millis(lease_time),<EOL>thread_id=thread_id(), timeout=to_millis(timeout),<EOL>reference_id=self.reference_id_generator.get_and_increment())<EOL>
Tries to acquire the lock. 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 timeout: (long), maximum time in seconds to wait for the lock (optional).
:param lease_time: (long), time in seconds to wait before releasing the lock (optional).
:return: (bool), ``true`` if the lock was acquired and otherwise, ``false``.