docstr: Invoke ray stop to clean ray processes.
docstr_tok: ["Invoke","ray","stop","to","clean","ray","processes","."]
code: def purge(self):
      """
      Invoke ray stop to clean ray processes.
      """
      if not self.initialized:
          print("The Ray cluster has not been launched.")
          return
      if self.is_local:
          import ray
  
          ray.shutdown()
      else:
          self.sc.range(
              0, self.total_cores, numSlices=self.total_cores
          ).mapPartitions(self.ray_service.gen_stop()).collect()
      self.initialized = False
  
imports: import os
  import re
  import subprocess
  import time
  import uuid
  import random
  import warnings
  import tempfile
  import filelock
  import multiprocessing
  from packaging import version
  from zoo.ray.process import session_execute, ProcessMonitor
  from zoo.ray.utils import is_local
  from zoo.ray.utils import resource_to_bytes
  from zoo.ray.utils import get_parent_pid
label_desc: Use image node_id 5 for calling the RayContext obj's underlying member method code with example usage: obj.purge() without return types