class_docstr: Implement a generic protocol to allow Orion to communicate using
  different storage backend
class_docstr_tok: ["Implement","a","generic","protocol","to","allow","Orion","to","communicate","using","different","storage","backend"]
docstr: Acquire lock on algorithm in storage
  
  This method is a contextmanager and should be called using the ``with``-clause.
  
  Parameters
  ----------
  experiment: Experiment
     experiment object to retrieve from the storage
  timeout: int, optional
      Timeout for the acquisition of the lock. If the lock is not
      obtained before ``timeout``, then ``LockAcquisitionTimeout`` is raised.
      The timeout is only for the acquisition of the lock.
      Once the lock is obtained, it is valid until the context manager is closed.
      Default: 600.
  retry_interval: int, optional
      Sleep time between each attempts at acquiring the lock. Default: 1
  
  Raises
  ------
  ``orion.storage.base.LockAcquisitionTimeout``
      The lock could not be obtained in less than ``timeout`` seconds.
docstr_tok: ["Acquire","lock","on","algorithm","in","storage","This","method","is","a","contextmanager","and","should","be","called","using","the","``","with","``","-clause",".","Parameters","--","--","--","--","--","experiment",":","Experiment","experiment","object","to","retrieve","from","the","storage","timeout",":","int",",","optional","Timeout","for","the","acquisition","of","the","lock",".","If","the","lock","is","not","obtained","before","``","timeout","``",",","then","``","LockAcquisitionTimeout","``","is","raised",".","The","timeout","is","only","for","the","acquisition","of","the","lock",".","Once","the","lock","is","obtained",",","it","is","valid","until","the","context","manager","is","closed",".","Default",":","600.","retry_interval",":","int",",","optional","Sleep","time","between","each","attempts","at","acquiring","the","lock",".","Default",":","1","Raises","--","--","--","``","orion.storage.base.LockAcquisitionTimeout","``","The","lock","could","not","be","obtained","in","less","than","``","timeout","``","seconds","."]
code: def acquire_algorithm_lock(
      self,
      experiment: Experiment,
      timeout: int = 600,
      retry_interval: int = 1,
  ) -> typing.Generator[LockedAlgorithmState, None, None]:
      """Acquire lock on algorithm in storage
  
      This method is a contextmanager and should be called using the ``with``-clause.
  
      Parameters
      ----------
      experiment: Experiment
         experiment object to retrieve from the storage
      timeout: int, optional
          Timeout for the acquisition of the lock. If the lock is not
          obtained before ``timeout``, then ``LockAcquisitionTimeout`` is raised.
          The timeout is only for the acquisition of the lock.
          Once the lock is obtained, it is valid until the context manager is closed.
          Default: 600.
      retry_interval: int, optional
          Sleep time between each attempts at acquiring the lock. Default: 1
  
      Raises
      ------
      ``orion.storage.base.LockAcquisitionTimeout``
          The lock could not be obtained in less than ``timeout`` seconds.
      """
      raise NotImplementedError()
  
imports: from __future__ import annotations
  import contextlib
  import copy
  import logging
  import typing
  from datetime import datetime
  from typing import Literal
  import orion.core
  from orion.core.io import resolve_config
  from orion.core.utils import GenericFactory
label_desc: Use image node_id 29 for calling the BaseStorageProtocol obj's underlying member method code with example usage: obj.acquire_algorithm_lock(experiment, timeout, retry_interval) without return types