class_docstr: Syft Lock implementations.
  
  Params:
      config: Config specific to a locking strategy.
docstr: Acquire a lock, blocking or non-blocking.
  :param bool blocking: acquire a lock in a blocking or non-blocking
                        fashion. Defaults to True.
  :returns: if the lock was successfully acquired or not
  :rtype: bool
docstr_tok: ["Acquire","a","lock",",","blocking","or","non-blocking",".",":","param","bool","blocking",":","acquire","a","lock","in","a","blocking","or","non-blocking","fashion",".","Defaults","to","True",".",":","returns",":","if","the","lock","was","successfully","acquired","or","not",":","rtype",":","bool"]
code: def acquire(self, blocking: bool = True) -> bool:
      """
      Acquire a lock, blocking or non-blocking.
      :param bool blocking: acquire a lock in a blocking or non-blocking
                            fashion. Defaults to True.
      :returns: if the lock was successfully acquired or not
      :rtype: bool
      """
  
      if not blocking:
          return self._acquire()
  
      timeout = self.timeout
      start_time = time.time()
      elapsed = 0
      while timeout >= elapsed:
          if not self._acquire():
              time.sleep(self.retry_interval)
              elapsed = time.time() - start_time
          else:
              return True
      print(
          f"Timeout elapsed after {self.timeout} seconds while trying to acquiring lock."
      )
      # third party
      return False
  
imports: from collections import defaultdict
  import datetime
  import json
  from pathlib import Path
  import threading
  import time
  from typing import Callable
  from typing import Dict
  from typing import Optional
  import uuid
  from pydantic import BaseModel
  import redis
  from sherlock.lock import BaseLock
  from sherlock.lock import FileLock
  from sherlock.lock import RedisLock
  from ..serde.serializable import serializable
label_desc: Use image node_id 3 for calling the SyftLock obj's underlying member method code with example usage: obj.acquire(blocking) and returns: False, self, True