@classmethod
def _map_training_config(cls, static_hyperparameters, input_mode, role,
    output_config, resource_config, stop_condition, input_config=None,
    metric_definitions=None, image=None, algorithm_arn=None, vpc_config=
    None, enable_network_isolation=False, encrypt_inter_container_traffic=
    False, estimator_name=None, objective_type=None, objective_metric_name=
    None, parameter_ranges=None, train_use_spot_instances=False,
    checkpoint_s3_uri=None, checkpoint_local_path=None):
    """
        Construct a dictionary of training job configuration from the arguments

        Args:
            static_hyperparameters (dict): Hyperparameters for model training. These
                hyperparameters remain unchanged across all of the training jobs for the
                hyperparameter tuning job. The hyperparameters are made accessible as a dictionary
                for the training code on SageMaker.
            input_mode (str): The input mode that the algorithm supports. Valid modes:

                * 'File' - Amazon SageMaker copies the training dataset from the S3 location to
                    a directory in the Docker container.
                * 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via a
                    Unix-named pipe.

            role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker training
                jobs and APIs that create Amazon SageMaker endpoints use this role to access
                training data and model artifacts. You must grant sufficient permissions to
                this role.
            output_config (dict): The S3 URI where you want to store the training results and
                optional KMS key ID.
            resource_config (dict): Contains values for ResourceConfig:

                * instance_count (int): Number of EC2 instances to use for training.
                    The key in resource_config is 'InstanceCount'.
                * instance_type (str): Type of EC2 instance to use for training, for example,
                    'ml.c4.xlarge'. The key in resource_config is 'InstanceType'.

            stop_condition (dict): When training should finish, e.g. ``MaxRuntimeInSeconds``.
            input_config (list): A list of Channel objects. Each channel is a named input source.
                Please refer to the format details described:
                https://botocore.readthedocs.io/en/latest/reference/services/sagemaker.html#SageMaker.Client.create_training_job
            metric_definitions (list[dict]): A list of dictionaries that defines the metric(s)
                used to evaluate the training jobs. Each dictionary contains two keys: 'Name' for
                the name of the metric, and 'Regex' for the regular expression used to extract the
                metric from the logs. This should be defined only for jobs that don't use an
                Amazon algorithm.
            image (str): Docker image containing training code.
            algorithm_arn (str): Resource ARN for training algorithm created or subscribed on
                AWS Marketplace
            vpc_config (dict): Contains values for VpcConfig (default: None):

                * subnets (list[str]): List of subnet ids.
                    The key in vpc_config is 'Subnets'.
                * security_group_ids (list[str]): List of security group ids.
                    The key in vpc_config is 'SecurityGroupIds'.

            enable_network_isolation (bool): Specifies whether to isolate the training container
            encrypt_inter_container_traffic (bool): Specifies whether traffic between training
                containers is encrypted for the training jobs started for this hyperparameter
                tuning job (default: ``False``).
            estimator_name (str): Unique name for the estimator.
            objective_type (str): The type of the objective metric for evaluating training jobs.
                This value can be either 'Minimize' or 'Maximize'.
            objective_metric_name (str): Name of the metric for evaluating training jobs.
            parameter_ranges (dict): Dictionary of parameter ranges. These parameter ranges can
                be one of three types: Continuous, Integer, or Categorical.

        Returns:
            A dictionary of training job configuration. For format details, please refer to
            TrainingJobDefinition as described in
            https://botocore.readthedocs.io/en/latest/reference/services/sagemaker.html#SageMaker.Client.create_hyper_parameter_tuning_job

        """
    training_job_definition = {'StaticHyperParameters':
        static_hyperparameters, 'RoleArn': role, 'OutputDataConfig':
        output_config, 'ResourceConfig': resource_config,
        'StoppingCondition': stop_condition}
    algorithm_spec = {'TrainingInputMode': input_mode}
    if metric_definitions is not None:
        algorithm_spec['MetricDefinitions'] = metric_definitions
    if algorithm_arn:
        algorithm_spec['AlgorithmName'] = algorithm_arn
    else:
        algorithm_spec['TrainingImage'] = image
    training_job_definition['AlgorithmSpecification'] = algorithm_spec
    if input_config is not None:
        training_job_definition['InputDataConfig'] = input_config
    if vpc_config is not None:
        training_job_definition['VpcConfig'] = vpc_config
    if enable_network_isolation:
        training_job_definition['EnableNetworkIsolation'] = True
    if encrypt_inter_container_traffic:
        training_job_definition['EnableInterContainerTrafficEncryption'] = True
    if train_use_spot_instances:
        training_job_definition['EnableManagedSpotTraining'] = True
    if checkpoint_s3_uri:
        checkpoint_config = {'S3Uri': checkpoint_s3_uri}
        if checkpoint_local_path:
            checkpoint_config['LocalPath'] = checkpoint_local_path
        training_job_definition['CheckpointConfig'] = checkpoint_config
    if estimator_name is not None:
        training_job_definition['DefinitionName'] = estimator_name
    tuning_objective = cls._map_tuning_objective(objective_type,
        objective_metric_name)
    if tuning_objective is not None:
        training_job_definition['TuningObjective'] = tuning_objective
    if parameter_ranges is not None:
        training_job_definition['HyperParameterRanges'] = parameter_ranges
    return training_job_definition
