code: def _validate_cluster_config(
      chief_config, worker_count, worker_config, docker_parent_image
  ):
      """Validates cluster config params."""
      if not isinstance(chief_config, machine_config.MachineConfig):
          raise ValueError(
              "Invalid `chief_config` input. "
              'Expected "auto" or `MachineConfig` instance. '
              "Received {}.".format(chief_config)
          )
  
      if worker_count < 0:
          raise ValueError(
              "Invalid `worker_count` input. "
              "Expected a postive integer value. "
              "Received {}.".format(worker_count)
          )
  
      if worker_count > 0 and not isinstance(
          worker_config, machine_config.MachineConfig
      ):
          raise ValueError(
              "Invalid `worker_config` input. "
              'Expected "auto" or `MachineConfig` instance. '
              "Received {}.".format(worker_config)
          )
  
      if machine_config.is_tpu_config(chief_config):
          raise ValueError(
              "Invalid `chief_config` input. "
              "`chief_config` cannot be a TPU config. "
              "Received {}.".format(chief_config)
          )
  
      if machine_config.is_tpu_config(worker_config):
          if worker_count != 1:
              raise ValueError(
                  "Invalid `worker_count` input. "
                  "Expected worker_count=1 for TPU `worker_config`. "
                  "Received {}.".format(worker_count)
              )
  
file_path: cloud/src/python/tensorflow_cloud/core/validate.py
imports: import os
  from .None import gcp
  from .None import machine_config
label_desc: Use image node_id 4 for calling a global function with example usage: _validate_cluster_config(chief_config, worker_count, worker_config, docker_parent_image) without return types