code: def update(self, key, value):
      import random
  
      if random.randrange(10) < 5:
          sys.exit(1)
  
      self.state[key] = value
  
      # Checkpoint the latest state
      with open(self.checkpoint_file, "w") as f:
          json.dump(self.state, f)
  
file_path: ray/doc/source/ray-core/doc_code/actor_checkpointing.py
imports: import os
  import sys
  import ray
  import json
  import tempfile
  import shutil
label_desc: Use image node_id 2 for calling the ImmortalActor obj's underlying member method code with example usage: obj.update(key, value) without return types