code: def __init__(self, checkpoint_file):
      self.checkpoint_file = checkpoint_file
  
      if os.path.exists(self.checkpoint_file):
          # Restore from a checkpoint
          with open(self.checkpoint_file, "r") as f:
              self.state = json.load(f)
      else:
          self.state = {}
  
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 1 to create a new ImmortalActor object  with example: obj = ImmortalActor(checkpoint_file)