code: def resolve_model_sagemaker_config_field(
      field_name: str,
      field_val: Optional[Any],
      sagemaker_session: Session,
      default_value: Optional[str] = None,
  ) -> Any:
      """Given a field name, checks if there is a sagemaker config value to set.
  
      For the role field, which is customer-supplied, we allow ``field_val`` to take precedence
      over sagemaker config values. For all other fields, sagemaker config values take precedence
      over the JumpStart default fields.
      """
      # In case, sagemaker_session is None, get sagemaker_config from load_sagemaker_config()
      # to resolve value from config for the respective field_name parameter
      _sagemaker_config = (
          load_sagemaker_config()
          if (sagemaker_session is None)
          else None
      )
  
      # We allow customers to define a role which takes precedence
      # over the one defined in sagemaker config
      if field_name == "role":
          return resolve_value_from_config(
              direct_input=field_val,
              config_path=MODEL_EXECUTION_ROLE_ARN_PATH,
              default_value=default_value
              or sagemaker_session.get_caller_identity_arn(),
              sagemaker_session=sagemaker_session,
              sagemaker_config=_sagemaker_config,
          )
  
      # JumpStart Models have certain default field values. We want
      # sagemaker config values to take priority over the model-specific defaults.
      if field_name == "enable_network_isolation":
          resolved_val = resolve_value_from_config(
              direct_input=None,
              config_path=MODEL_ENABLE_NETWORK_ISOLATION_PATH,
              sagemaker_session=sagemaker_session,
              default_value=default_value,
              sagemaker_config=_sagemaker_config,
          )
          return resolved_val if resolved_val is not None else field_val
  
      # field is not covered by sagemaker config so return as is
      return field_val
  
imports: from __future__ import absolute_import
  import logging
  import os
  from typing import Any, Dict, List, Optional, Union
  from urllib.parse import urlparse
  import boto3
  from packaging.version import Version
  import sagemaker
  from sagemaker.config.config_schema import MODEL_ENABLE_NETWORK_ISOLATION_PATH, MODEL_EXECUTION_ROLE_ARN_PATH, TRAINING_JOB_ENABLE_NETWORK_ISOLATION_PATH, TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH, TRAINING_JOB_ROLE_ARN_PATH
  from sagemaker.jumpstart import constants, enums
  from sagemaker.jumpstart import accessors
  from sagemaker.s3 import parse_s3_url
  from sagemaker.jumpstart.exceptions import DeprecatedJumpStartModelError, VulnerableJumpStartModelError, get_old_model_version_msg
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs, JumpStartVersionedModelId
  from sagemaker.session import Session
  from sagemaker.config import load_sagemaker_config
  from sagemaker.utils import resolve_value_from_config, TagsDict
  from sagemaker.workflow import is_pipeline_variable
label_desc: Use image node_id 19 for calling a global function with example usage: resolve_model_sagemaker_config_field(field_name, field_val, sagemaker_session, default_value) and returns: field_val, resolve_value_from_config, unknown