code: def _validate_smdataparallel_args(
      instance_type,
      framework_name,
      framework_version,
      py_version,
      distribution,
      image_uri=None,
  ):
      """Check if request is using unsupported arguments.
  
      Validate if user specifies a supported instance type, framework version, and python
      version.
  
      Args:
          instance_type (str): A string representing the type of training instance selected. Ex: `ml.p3.16xlarge`
          framework_name (str): A string representing the name of framework selected. Ex: `tensorflow`
          framework_version (str): A string representing the framework version selected. Ex: `2.3.1`
          py_version (str): A string representing the python version selected. Ex: `py3`
          distribution (dict): A dictionary with information to enable distributed training.
              (Defaults to None if distributed training is not enabled.) Ex:
  
              .. code:: python
  
                  {
                      "smdistributed": {
                          "dataparallel": {
                              "enabled": True
                          }
                      }
                  }
          image_uri (str): A string representing a Docker image URI.
  
      Raises:
          ValueError: if
              (`instance_type` is not in SM_DATAPARALLEL_SUPPORTED_INSTANCE_TYPES or
              `py_version` is not python3 or
              `framework_version` is not in SM_DATAPARALLEL_SUPPORTED_FRAMEWORK_VERSION
      """
      smdataparallel_enabled = (
          distribution.get("smdistributed")
          .get("dataparallel")
          .get("enabled", False)
      )
  
      if not smdataparallel_enabled:
          return
  
      is_instance_type_supported = (
          instance_type in SM_DATAPARALLEL_SUPPORTED_INSTANCE_TYPES
      )
  
      err_msg = ""
  
      if not is_instance_type_supported:
          # instance_type is required
          err_msg += (
              f"Provided instance_type {instance_type} is not supported by smdataparallel.\n"
              "Please specify one of the supported instance types:"
              f"{SM_DATAPARALLEL_SUPPORTED_INSTANCE_TYPES}\n"
          )
  
      if not image_uri:
          # ignore framework_version & py_version if image_uri is set
          # in case image_uri is not set, then both are mandatory
          supported = SM_DATAPARALLEL_SUPPORTED_FRAMEWORK_VERSIONS[
              framework_name
          ]
          if framework_version not in supported:
              err_msg += (
                  f"Provided framework_version {framework_version} is not supported by"
                  " smdataparallel.\n"
                  f"Please specify one of the supported framework versions: {supported} \n"
              )
  
          if "py3" not in py_version:
              err_msg += (
                  f"Provided py_version {py_version} is not supported by smdataparallel.\n"
                  "Please specify py_version>=py3"
              )
  
      if err_msg:
          raise ValueError(err_msg)
  
imports: from __future__ import absolute_import
  import json
  import logging
  import os
  import re
  import time
  import shutil
  import tempfile
  from collections import namedtuple
  from typing import List, Optional, Union, Dict
  from packaging import version
  import sagemaker.image_uris
  from sagemaker.instance_group import InstanceGroup
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.session_settings import SessionSettings
  import sagemaker.utils
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.deprecations import renamed_warning, renamed_kwargs
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.deprecations import deprecation_warn_base
label_desc: Use image node_id 14 for calling a global function with example usage: _validate_smdataparallel_args(instance_type, framework_name, framework_version, py_version, distribution, image_uri) without return types