code: def _get_template_pool_lock(self, id):
          
          try:
              return self._hosting_device_locks[id]
          except KeyError:
              self._hosting_device_locks[id] = threading.Lock()
              return self._hosting_device_locks.get(id)
docs: Returns lock object for hosting device template with <id>.