class_docstr: A class for creating and interacting with SageMaker AutoML jobs.
docstr: Creates a model from a given candidate or the best candidate from the job.
  
  Args:
      name (str): The pipeline model name.
      sagemaker_session (sagemaker.session.Session): A SageMaker Session
          object, used for SageMaker interactions (default: None). If not
          specified, the one originally associated with the ``AutoML`` instance is used.:
      candidate (CandidateEstimator or dict): a CandidateEstimator used for deploying
          to a SageMaker Inference Pipeline. If None, the best candidate will
          be used. If the candidate input is a dict, a CandidateEstimator will be
          created from it.
      vpc_config (dict): Specifies a VPC that your training jobs and hosted models have
          access to. Contents include "SecurityGroupIds" and "Subnets".
      enable_network_isolation (bool): Isolates the training container. No inbound or
          outbound network calls can be made, except for calls between peers within a
          training cluster for distributed training. Default: False
      model_kms_key (str): KMS key ARN used to encrypt the repacked
          model archive file if the model is repacked
      predictor_cls (callable[string, sagemaker.session.Session]): A
          function to call to create a predictor (default: None). If
          specified, ``deploy()``  returns the result of invoking this
          function on the created endpoint name.
      inference_response_keys (list): List of keys for response content. The order of the
          keys will dictate the content order in the response.
  
  Returns:
      PipelineModel object.
docstr_tok: ["Creates","a","model","from","a","given","candidate","or","the","best","candidate","from","the","job",".","Args",":","name","(","str",")",":","The","pipeline","model","name",".","sagemaker_session","(","sagemaker.session.Session",")",":","A","SageMaker","Session","object",",","used","for","SageMaker","interactions","(","default",":","None",")",".","If","not","specified",",","the","one","originally","associated","with","the","``","AutoML","``","instance","is","used",".",":","candidate","(","CandidateEstimator","or","dict",")",":","a","CandidateEstimator","used","for","deploying","to","a","SageMaker","Inference","Pipeline",".","If","None",",","the","best","candidate","will","be","used",".","If","the","candidate","input","is","a","dict",",","a","CandidateEstimator","will","be","created","from","it",".","vpc_config","(","dict",")",":","Specifies","a","VPC","that","your","training","jobs","and","hosted","models","have","access","to",".","Contents","include","``","SecurityGroupIds","''","and","``","Subnets","''",".","enable_network_isolation","(","bool",")",":","Isolates","the","training","container",".","No","inbound","or","outbound","network","calls","can","be","made",",","except","for","calls","between","peers","within","a","training","cluster","for","distributed","training",".","Default",":","False","model_kms_key","(","str",")",":","KMS","key","ARN","used","to","encrypt","the","repacked","model","archive","file","if","the","model","is","repacked","predictor_cls","(","callable","[","string",",","sagemaker.session.Session","]",")",":","A","function","to","call","to","create","a","predictor","(","default",":","None",")",".","If","specified",",","``","deploy","(",")","``","returns","the","result","of","invoking","this","function","on","the","created","endpoint","name",".","inference_response_keys","(","list",")",":","List","of","keys","for","response","content",".","The","order","of","the","keys","will","dictate","the","content","order","in","the","response",".","Returns",":","PipelineModel","object","."]
code: def create_model(
      self,
      name,
      sagemaker_session=None,
      candidate=None,
      vpc_config=None,
      enable_network_isolation=False,
      model_kms_key=None,
      predictor_cls=None,
      inference_response_keys=None,
  ):
      """Creates a model from a given candidate or the best candidate from the job.
  
      Args:
          name (str): The pipeline model name.
          sagemaker_session (sagemaker.session.Session): A SageMaker Session
              object, used for SageMaker interactions (default: None). If not
              specified, the one originally associated with the ``AutoML`` instance is used.:
          candidate (CandidateEstimator or dict): a CandidateEstimator used for deploying
              to a SageMaker Inference Pipeline. If None, the best candidate will
              be used. If the candidate input is a dict, a CandidateEstimator will be
              created from it.
          vpc_config (dict): Specifies a VPC that your training jobs and hosted models have
              access to. Contents include "SecurityGroupIds" and "Subnets".
          enable_network_isolation (bool): Isolates the training container. No inbound or
              outbound network calls can be made, except for calls between peers within a
              training cluster for distributed training. Default: False
          model_kms_key (str): KMS key ARN used to encrypt the repacked
              model archive file if the model is repacked
          predictor_cls (callable[string, sagemaker.session.Session]): A
              function to call to create a predictor (default: None). If
              specified, ``deploy()``  returns the result of invoking this
              function on the created endpoint name.
          inference_response_keys (list): List of keys for response content. The order of the
              keys will dictate the content order in the response.
  
      Returns:
          PipelineModel object.
      """
      sagemaker_session = sagemaker_session or self.sagemaker_session
  
      if candidate is None:
          candidate_dict = self.best_candidate()
          candidate = CandidateEstimator(
              candidate_dict, sagemaker_session=sagemaker_session
          )
      elif isinstance(candidate, dict):
          candidate = CandidateEstimator(
              candidate, sagemaker_session=sagemaker_session
          )
  
      inference_containers = candidate.containers
  
      self.validate_and_update_inference_response(
          inference_containers, inference_response_keys
      )
  
      # construct Model objects
      models = []
  
      for container in inference_containers:
          image_uri = container["Image"]
          model_data = container["ModelDataUrl"]
          env = container["Environment"]
  
          model = Model(
              image_uri=image_uri,
              model_data=model_data,
              role=self.role,
              env=env,
              vpc_config=vpc_config,
              sagemaker_session=sagemaker_session
              or self.sagemaker_session,
              enable_network_isolation=enable_network_isolation,
              model_kms_key=model_kms_key,
          )
          models.append(model)
  
      pipeline = PipelineModel(
          models=models,
          role=self.role,
          predictor_cls=predictor_cls,
          name=name,
          vpc_config=vpc_config,
          enable_network_isolation=enable_network_isolation,
          sagemaker_session=sagemaker_session or self.sagemaker_session,
      )
      return pipeline
  
imports: from __future__ import absolute_import
  import logging
  from typing import Optional, List, Dict
  from six import string_types
  from sagemaker import Model, PipelineModel, s3
  from sagemaker.automl.candidate_estimator import CandidateEstimator
  from sagemaker.config import AUTO_ML_ROLE_ARN_PATH, AUTO_ML_KMS_KEY_ID_PATH, AUTO_ML_VPC_CONFIG_PATH, AUTO_ML_VOLUME_KMS_KEY_ID_PATH, AUTO_ML_INTER_CONTAINER_ENCRYPTION_PATH
  from sagemaker.job import _Job
  from sagemaker.session import Session
  from sagemaker.utils import name_from_base, resolve_value_from_config, format_tags, Tags
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.pipeline_context import runnable_by_pipeline
label_desc: Use image node_id 7 for calling the AutoML obj's underlying member method code with example usage: obj.create_model(name, sagemaker_session, candidate, vpc_config, enable_network_isolation, model_kms_key, predictor_cls, inference_response_keys) and returns: pipeline