def hpo_job_create(sm_client, tuning_job_name, tuning_job_config, training_job_config, warm_start_config=None):
  """API call to create a hyperparameter tuning job."""
  try:
    if (warm_start_config):
      response = sm_client.create_hyper_parameter_tuning_job(
        HyperParameterTuningJobName=tuning_job_name,
        HyperParameterTuningJobConfig=tuning_job_config,
        TrainingJobDefinition=training_job_config,
        WarmStartConfig=warm_start_config
      )
      print(f"Starting hyperparameter job with warmstart configuration: '{tuning_job_name}' ...")
    else:
      response = sm_client.create_hyper_parameter_tuning_job(
        HyperParameterTuningJobName=tuning_job_name,
        HyperParameterTuningJobConfig=tuning_job_config,
        TrainingJobDefinition=training_job_config
      )
      print(f"Starting hyperparameter job with configuration: '{tuning_job_name}' ...")

    tuning_job_arn = response["HyperParameterTuningJobArn"]
    return tuning_job_arn
  except sm_client.exceptions.ResourceInUse:
    raise Exception(f"Hyperparameter job resource already in use: '{tuning_job_name}'")