class_docstr: An in-memory implementation of the Storage interface. This implementation
  is not durable
class_docstr_tok: ["An","in-memory","implementation","of","the","Storage","interface",".","This","implementation","is","not","durable"]
code: def update(
      self,
      table: str,
      key: str,
      value: str,
      expected_entry_version: Optional[int] = None,
      expected_storage_version: Optional[int] = None,
      insert_only: bool = False,
  ) -> StoreStatus:
      with self._lock:
          if (
              expected_storage_version is not None
              and expected_storage_version != self._version
          ):
              return StoreStatus(False, self._version)
          if insert_only and key in self._tables[table]:
              return StoreStatus(False, self._version)
          _, version = self._tables[table].get(key, (None, -1))
          if (
              expected_entry_version is not None
              and expected_entry_version != version
          ):
              return StoreStatus(False, self._version)
          self._version += 1
          self._tables[table][key] = VersionedValue(
              value, self._version
          )
          return StoreStatus(True, self._version)
  
file_path: ray/python/ray/autoscaler/v2/instance_manager/storage.py
imports: import copy
  from abc import ABCMeta, abstractmethod
  from collections import defaultdict, namedtuple
  from threading import Lock
  from typing import Dict, List, Optional, Tuple
label_desc: Use image node_id 3 for calling the InMemoryStorage obj's underlying member method code with example usage: obj.update(table, key, value, expected_entry_version, expected_storage_version, insert_only) and returns: StoreStatus, StoreStatus, StoreStatus, StoreStatus