code: def set_progress_bars(enabled: bool) -> bool:
      """Set whether progress bars are enabled.
  
      The default behavior is controlled by the
      ``RAY_DATA_DISABLE_PROGRESS_BARS`` environment variable. By default,
      it is set to "0". Setting it to "1" will disable progress bars, unless
      they are reenabled by this method.
  
      Returns:
          Whether progress bars were previously enabled.
      """
      from ray.data import DataContext
  
      ctx = DataContext.get_current()
      old_value = ctx.enable_progress_bars
      ctx.enable_progress_bars = enabled
      return old_value
  
file_path: ray/python/ray/data/_internal/progress_bar.py
imports: import threading
  from typing import Any, List, Optional
  import ray
  from ray.experimental import tqdm_ray
  from ray.types import ObjectRef
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 1 for calling a global function with example usage: set_progress_bars(enabled) and returns: old_value