code: def locked(self, target):
          
          return operations.LockContext(self._session, self._device_handler, target)
docs: Returns a context manager for a lock on a datastore, where
          *target* is the name of the configuration datastore to lock, e.g.::
  
              with m.locked("running"):
                  # do your stuff
  
          ... instead of::
  
              m.lock("running")
              try:
                  # do your stuff
              finally:
                  m.unlock("running")