class_docstr: A class for SageMaker AutoML Job Candidate
docstr: Rerun a candidate's step jobs with new input datasets or security config.
  
  Args:
      inputs (str or list[str]): Local path or S3 Uri where the training data is stored. If a
          local path is provided, the dataset will be uploaded to an S3 location.
      candidate_name (str): name of the candidate to be rerun, if None, candidate's original
          name will be used.
      volume_kms_key (str): The KMS key id to encrypt data on the storage volume attached to
          the ML compute instance(s).
      encrypt_inter_container_traffic (bool): To encrypt all communications between ML compute
          instances in distributed training. If not passed, will be fetched from
          sagemaker_config if a value is defined there. Default: False.
      vpc_config (dict): Specifies a VPC that jobs and hosted models have access to.
          Control access to and from training and model containers by configuring the VPC
      wait (bool): Whether the call should wait until all jobs completes (default: True).
      logs (bool): Whether to show the logs produced by the job.
          Only meaningful when wait is True (default: True).
docstr_tok: ["Rerun","a","candidate","'s","step","jobs","with","new","input","datasets","or","security","config",".","Args",":","inputs","(","str","or","list","[","str","]",")",":","Local","path","or","S3","Uri","where","the","training","data","is","stored",".","If","a","local","path","is","provided",",","the","dataset","will","be","uploaded","to","an","S3","location",".","candidate_name","(","str",")",":","name","of","the","candidate","to","be","rerun",",","if","None",",","candidate","'s","original","name","will","be","used",".","volume_kms_key","(","str",")",":","The","KMS","key","id","to","encrypt","data","on","the","storage","volume","attached","to","the","ML","compute","instance","(","s",")",".","encrypt_inter_container_traffic","(","bool",")",":","To","encrypt","all","communications","between","ML","compute","instances","in","distributed","training",".","If","not","passed",",","will","be","fetched","from","sagemaker_config","if","a","value","is","defined","there",".","Default",":","False",".","vpc_config","(","dict",")",":","Specifies","a","VPC","that","jobs","and","hosted","models","have","access","to",".","Control","access","to","and","from","training","and","model","containers","by","configuring","the","VPC","wait","(","bool",")",":","Whether","the","call","should","wait","until","all","jobs","completes","(","default",":","True",")",".","logs","(","bool",")",":","Whether","to","show","the","logs","produced","by","the","job",".","Only","meaningful","when","wait","is","True","(","default",":","True",")","."]
code: def fit(
      self,
      inputs,
      candidate_name=None,
      volume_kms_key=None,
      # default of False for training job, checked inside function
      encrypt_inter_container_traffic=None,
      vpc_config=None,
      wait=True,
      logs=True,
  ):
      """Rerun a candidate's step jobs with new input datasets or security config.
  
      Args:
          inputs (str or list[str]): Local path or S3 Uri where the training data is stored. If a
              local path is provided, the dataset will be uploaded to an S3 location.
          candidate_name (str): name of the candidate to be rerun, if None, candidate's original
              name will be used.
          volume_kms_key (str): The KMS key id to encrypt data on the storage volume attached to
              the ML compute instance(s).
          encrypt_inter_container_traffic (bool): To encrypt all communications between ML compute
              instances in distributed training. If not passed, will be fetched from
              sagemaker_config if a value is defined there. Default: False.
          vpc_config (dict): Specifies a VPC that jobs and hosted models have access to.
              Control access to and from training and model containers by configuring the VPC
          wait (bool): Whether the call should wait until all jobs completes (default: True).
          logs (bool): Whether to show the logs produced by the job.
              Only meaningful when wait is True (default: True).
      """
      if logs and not wait:
          raise ValueError(
              """Logs can only be shown if wait is set to True.
                  Please either set wait to True or set logs to False."""
          )
      vpc_config = resolve_value_from_config(
          vpc_config,
          TRAINING_JOB_VPC_CONFIG_PATH,
          sagemaker_session=self.sagemaker_session,
      )
      volume_kms_key = resolve_value_from_config(
          volume_kms_key,
          TRAINING_JOB_VOLUME_KMS_KEY_ID_PATH,
          sagemaker_session=self.sagemaker_session,
      )
      self.name = candidate_name or self.name
      running_jobs = {}
  
      # convert inputs to TrainingInput format
      if isinstance(inputs, string_types):
          if not inputs.startswith("s3://"):
              inputs = self.sagemaker_session.upload_data(
                  inputs, key_prefix="auto-ml-input-data"
              )
  
      for step in self.steps:
          step_type = step["type"]
          step_name = step["name"]
          if step_type == "TrainingJob":
              # prepare inputs
              input_dict = {}
              if isinstance(inputs, string_types):
                  input_dict["train"] = _Job._format_string_uri_input(
                      inputs
                  )
              else:
                  msg = "Cannot format input {}. Expecting a string."
                  raise ValueError(msg.format(inputs))
  
              channels = [
                  _Job._convert_input_to_channel(name, input)
                  for name, input in input_dict.items()
              ]
  
              desc = self.sagemaker_session.sagemaker_client.describe_training_job(
                  TrainingJobName=step_name
              )
              base_name = "sagemaker-automl-training-rerun"
              step_name = name_from_base(base_name)
              step["name"] = step_name
  
              # Check training_job config not auto_ml_job config because this function calls
              # training job API
              _encrypt_inter_container_traffic = resolve_value_from_config(
                  direct_input=encrypt_inter_container_traffic,
                  config_path=TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH,
                  default_value=False,
                  sagemaker_session=self.sagemaker_session,
              )
  
              train_args = self._get_train_args(
                  desc,
                  channels,
                  step_name,
                  volume_kms_key,
                  _encrypt_inter_container_traffic,
                  vpc_config,
              )
              self.sagemaker_session.train(**train_args)
              running_jobs[step_name] = True
  
          elif step_type == "TransformJob":
              # prepare inputs
              if not isinstance(
                  inputs, string_types
              ) or not inputs.startswith("s3://"):
                  msg = "Cannot format input {}. Expecting a string starts with file:// or s3://"
                  raise ValueError(msg.format(inputs))
  
              desc = self.sagemaker_session.sagemaker_client.describe_transform_job(
                  TransformJobName=step_name
              )
              base_name = "sagemaker-automl-transform-rerun"
              step_name = name_from_base(base_name)
              step["name"] = step_name
              transform_args = self._get_transform_args(
                  desc, inputs, step_name, volume_kms_key
              )
              self.sagemaker_session.transform(**transform_args)
              running_jobs[step_name] = True
  
      if wait:
          while True:
              for step in self.steps:
                  status = None
                  step_type = step["type"]
                  step_name = step["name"]
                  if step_type == "TrainingJob":
                      status = self.sagemaker_session.sagemaker_client.describe_training_job(
                          TrainingJobName=step_name
                      )[
                          "TrainingJobStatus"
                      ]
                  elif step_type == "TransformJob":
                      status = self.sagemaker_session.sagemaker_client.describe_transform_job(
                          TransformJobName=step_name
                      )[
                          "TransformJobStatus"
                      ]
                  if status in ("Completed", "Failed", "Stopped"):
                      running_jobs[step_name] = False
              if self._check_all_job_finished(running_jobs):
                  break
  
imports: from __future__ import absolute_import
  from six import string_types
  from sagemaker.config import TRAINING_JOB_VPC_CONFIG_PATH, TRAINING_JOB_VOLUME_KMS_KEY_ID_PATH, TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH
  from sagemaker.session import Session
  from sagemaker.job import _Job
  from sagemaker.utils import name_from_base, resolve_value_from_config
label_desc: Use image node_id 3 for calling the CandidateEstimator obj's underlying member method code with example usage: obj.fit(inputs, candidate_name, volume_kms_key, encrypt_inter_container_traffic, vpc_config, wait, logs) without return types