code: def get_init_kwargs(
      model_id: str,
      model_from_estimator: bool = False,
      model_version: Optional[str] = None,
      tolerate_vulnerable_model: Optional[bool] = None,
      tolerate_deprecated_model: Optional[bool] = None,
      instance_type: Optional[str] = None,
      region: Optional[str] = None,
      image_uri: Optional[Union[str, PipelineVariable]] = None,
      model_data: Optional[Union[str, PipelineVariable, dict]] = None,
      role: Optional[str] = None,
      predictor_cls: Optional[callable] = None,
      env: Optional[Dict[str, Union[str, PipelineVariable]]] = None,
      name: Optional[str] = None,
      vpc_config: Optional[
          Dict[str, List[Union[str, PipelineVariable]]]
      ] = None,
      sagemaker_session: Optional[Session] = None,
      enable_network_isolation: Union[bool, PipelineVariable] = None,
      model_kms_key: Optional[str] = None,
      image_config: Optional[
          Dict[str, Union[str, PipelineVariable]]
      ] = None,
      source_dir: Optional[str] = None,
      code_location: Optional[str] = None,
      entry_point: Optional[str] = None,
      container_log_level: Optional[
          Union[int, PipelineVariable]
      ] = None,
      dependencies: Optional[List[str]] = None,
      git_config: Optional[Dict[str, str]] = None,
      model_package_arn: Optional[str] = None,
      training_instance_type: Optional[str] = None,
      disable_instance_type_logging: bool = False,
      resources: Optional[ResourceRequirements] = None,
  ) -> JumpStartModelInitKwargs:
      """Returns kwargs required to instantiate `sagemaker.estimator.Model` object."""
  
      model_init_kwargs: JumpStartModelInitKwargs = (
          JumpStartModelInitKwargs(
              model_id=model_id,
              model_version=model_version,
              instance_type=instance_type,
              region=region,
              image_uri=image_uri,
              model_data=model_data,
              source_dir=source_dir,
              entry_point=entry_point,
              env=env,
              predictor_cls=predictor_cls,
              role=role,
              name=name,
              vpc_config=vpc_config,
              sagemaker_session=sagemaker_session,
              enable_network_isolation=enable_network_isolation,
              model_kms_key=model_kms_key,
              image_config=image_config,
              code_location=code_location,
              container_log_level=container_log_level,
              dependencies=dependencies,
              git_config=git_config,
              tolerate_deprecated_model=tolerate_deprecated_model,
              tolerate_vulnerable_model=tolerate_vulnerable_model,
              model_package_arn=model_package_arn,
              training_instance_type=training_instance_type,
              resources=resources,
          )
      )
  
      model_init_kwargs = _add_model_version_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      model_init_kwargs = (
          _add_vulnerable_and_deprecated_status_to_kwargs(
              kwargs=model_init_kwargs
          )
      )
  
      model_init_kwargs = _add_region_to_kwargs(
          kwargs=model_init_kwargs
      )
      model_init_kwargs = _add_sagemaker_session_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      model_init_kwargs = _add_model_name_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      model_init_kwargs = _add_instance_type_to_kwargs(
          kwargs=model_init_kwargs,
          disable_instance_type_logging=disable_instance_type_logging,
      )
  
      model_init_kwargs = _add_image_uri_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      # we use the model artifact from the training job output
      if not model_from_estimator:
          model_init_kwargs = _add_model_data_to_kwargs(
              kwargs=model_init_kwargs
          )
  
      model_init_kwargs = _add_source_dir_to_kwargs(
          kwargs=model_init_kwargs
      )
      model_init_kwargs = _add_entry_point_to_kwargs(
          kwargs=model_init_kwargs
      )
      model_init_kwargs = _add_env_to_kwargs(kwargs=model_init_kwargs)
      model_init_kwargs = _add_predictor_cls_to_kwargs(
          kwargs=model_init_kwargs
      )
      model_init_kwargs = _add_extra_model_kwargs(
          kwargs=model_init_kwargs
      )
      model_init_kwargs = _add_role_to_kwargs(kwargs=model_init_kwargs)
  
      model_init_kwargs = _add_model_package_arn_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      model_init_kwargs = _add_resources_to_kwargs(
          kwargs=model_init_kwargs
      )
  
      return model_init_kwargs
  
imports: from __future__ import absolute_import
  import json
  from typing import Any, Dict, List, Optional, Union
  from sagemaker import environment_variables, image_uris, instance_types, model_uris, script_uris
  from sagemaker.async_inference.async_inference_config import AsyncInferenceConfig
  from sagemaker.base_deserializers import BaseDeserializer
  from sagemaker.base_serializers import BaseSerializer
  from sagemaker.explainer.explainer_config import ExplainerConfig
  from sagemaker.jumpstart.artifacts import _model_supports_inference_script_uri, _retrieve_model_init_kwargs, _retrieve_model_deploy_kwargs, _retrieve_model_package_arn
  from sagemaker.jumpstart.artifacts.resource_names import _retrieve_resource_name_base
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, INFERENCE_ENTRY_POINT_SCRIPT_NAME, JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_LOGGER
  from sagemaker.model_metrics import ModelMetrics
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.jumpstart.enums import JumpStartScriptScope
  from sagemaker.jumpstart.types import JumpStartModelDeployKwargs, JumpStartModelInitKwargs, JumpStartModelRegisterKwargs
  from sagemaker.jumpstart.utils import add_jumpstart_model_id_version_tags, update_dict_if_key_not_present, resolve_model_sagemaker_config_field, verify_model_region_and_return_specs
  from sagemaker.model_monitor.data_capture_config import DataCaptureConfig
  from sagemaker.base_predictor import Predictor
  from sagemaker import accept_types, content_types, serializers, deserializers
  from sagemaker.serverless.serverless_inference_config import ServerlessInferenceConfig
  from sagemaker.session import Session
  from sagemaker.utils import name_from_base, format_tags, Tags
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
  from sagemaker import resource_requirements
  from sagemaker.enums import EndpointType
label_desc: Use image node_id 23 for calling a global function with example usage: get_init_kwargs(model_id, model_from_estimator, model_version, tolerate_vulnerable_model, tolerate_deprecated_model, instance_type, region, image_uri, model_data, role, predictor_cls, env, name, vpc_config, sagemaker_session, enable_network_isolation, model_kms_key, image_config, source_dir, code_location, entry_point, container_log_level, dependencies, git_config, model_package_arn, training_instance_type, disable_instance_type_logging, resources) and returns: model_init_kwargs