nodes: 0, module; 1, function_definition; 2, function_name:get_checkpoints_for_actor; 3, parameters; 4, block; 5, identifier:actor_id; 6, expression_statement; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Get the available checkpoints for the given actor ID, return a list
      sorted by checkpoint timestamp in descending order.
      """; 12, assignment; 13, comparison_operator:checkpoint_info is None; 14, block; 15, assignment; 16, call; 17, identifier:checkpoint_info; 18, call; 19, identifier:checkpoint_info; 20, None; 21, return_statement; 22, identifier:checkpoints; 23, list_comprehension; 24, identifier:sorted; 25, argument_list; 26, attribute; 27, argument_list; 28, list; 29, call; 30, for_in_clause; 31, identifier:checkpoints; 32, keyword_argument; 33, keyword_argument; 34, attribute; 35, identifier:actor_checkpoint_info; 36, identifier:actor_id; 37, identifier:Checkpoint; 38, argument_list; 39, pattern_list; 40, call; 41, identifier:key; 42, lambda; 43, identifier:reverse; 44, True; 45, attribute; 46, identifier:global_state; 47, identifier:checkpoint_id; 48, identifier:timestamp; 49, identifier:checkpoint_id; 50, identifier:timestamp; 51, identifier:zip; 52, argument_list; 53, lambda_parameters; 54, attribute; 55, identifier:ray; 56, identifier:worker; 57, subscript; 58, subscript; 59, identifier:checkpoint; 60, identifier:checkpoint; 61, identifier:timestamp; 62, identifier:checkpoint_info; 63, string:"CheckpointIds"; 64, identifier:checkpoint_info; 65, string:"Timestamps"
code: def get_checkpoints_for_actor(actor_id):
      """Get the available checkpoints for the given actor ID, return a list
      sorted by checkpoint timestamp in descending order.
      """
      checkpoint_info = ray.worker.global_state.actor_checkpoint_info(actor_id)
      if checkpoint_info is None:
          return []
      checkpoints = [
          Checkpoint(checkpoint_id, timestamp) for checkpoint_id, timestamp in
          zip(checkpoint_info["CheckpointIds"], checkpoint_info["Timestamps"])
      ]
      return sorted(
          checkpoints,
          key=lambda checkpoint: checkpoint.timestamp,
          reverse=True,
      )