code: def rsync(
      cluster_config: Union[dict, str],
      *,
      source: Optional[str],
      target: Optional[str],
      down: bool,
      ip_address: Optional[str] = None,
      use_internal_ip: bool = False,
      no_config_cache: bool = False,
      should_bootstrap: bool = True,
  ):
      """Rsyncs files to or from the cluster.
  
      Args:
          cluster_config (Union[str, dict]): Either the config dict of the
              cluster, or a path pointing to a file containing the config.
          source: rsync source argument.
          target: rsync target argument.
          down: whether we're syncing remote -> local.
          ip_address: Address of node.
          use_internal_ip: Whether the provided ip_address is
              public or private.
          no_config_cache: Whether to disable the config cache and fully
              resolve all environment settings from the Cloud provider again.
          should_bootstrap: whether to bootstrap cluster config before syncing
  
      Raises:
          RuntimeError if the cluster head node is not found.
      """
      with _as_config_file(cluster_config) as config_file:
          return commands.rsync(
              config_file=config_file,
              source=source,
              target=target,
              override_cluster_name=None,
              down=down,
              ip_address=ip_address,
              use_internal_ip=use_internal_ip,
              no_config_cache=no_config_cache,
              all_nodes=False,
              should_bootstrap=should_bootstrap,
          )
  
imports: import json
  import os
  import tempfile
  from contextlib import contextmanager
  from typing import Any, Callable, Dict, Iterator, List, Optional, Union
  from ray.autoscaler._private import commands
  from ray.autoscaler._private.cli_logger import cli_logger
  from ray.autoscaler._private.event_system import CreateClusterEvent
  from ray.autoscaler._private.event_system import global_event_system
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 4 for calling a global function with example usage: rsync(cluster_config) and returns: commands