code: def task_finished():
      tasks = list_tasks()
      assert len(tasks) > 0
      assert tasks[0].worker_id
      assert tasks[0].worker_pid
      assert tasks[0].state == "FINISHED"
      return True
  
file_path: ray/python/ray/tests/runtime_env_container/test_log_file_exists.py
imports: import ray
  from pathlib import Path
  import re
  from ray.util.state import list_tasks
  from ray._private.test_utils import wait_for_condition, get_ray_default_worker_file_path
  import argparse
label_desc: Use image node_id 1 for calling a global function with example usage: task_finished() and returns: True