code: def test_huggingface_invalid_args():
      with pytest.raises(ValueError) as error:
          HuggingFace(
              py_version="py36",
              entry_point=SCRIPT_PATH,
              role=ROLE,
              instance_count=INSTANCE_COUNT,
              instance_type=GPU_INSTANCE_TYPE,
              transformers_version="4.2.1",
              pytorch_version="1.6",
              enable_sagemaker_metrics=False,
          )
      assert "use either full version or shortened version" in str(
          error
      )
  
      with pytest.raises(ValueError) as error:
          HuggingFace(
              py_version="py36",
              entry_point=SCRIPT_PATH,
              role=ROLE,
              instance_count=INSTANCE_COUNT,
              instance_type=GPU_INSTANCE_TYPE,
              pytorch_version="1.6",
              enable_sagemaker_metrics=False,
          )
      assert (
          "transformers_version, and image_uri are both None."
          in str(error)
      )
  
      with pytest.raises(ValueError) as error:
          HuggingFace(
              py_version="py36",
              entry_point=SCRIPT_PATH,
              role=ROLE,
              instance_count=INSTANCE_COUNT,
              instance_type=GPU_INSTANCE_TYPE,
              transformers_version="4.2.1",
              enable_sagemaker_metrics=False,
          )
      assert (
          "tensorflow_version and pytorch_version are both None."
          in str(error)
      )
  
      with pytest.raises(ValueError) as error:
          HuggingFace(
              py_version="py36",
              entry_point=SCRIPT_PATH,
              role=ROLE,
              instance_count=INSTANCE_COUNT,
              instance_type=GPU_INSTANCE_TYPE,
              transformers_version="4.2",
              pytorch_version="1.6",
              tensorflow_version="2.3",
              enable_sagemaker_metrics=False,
          )
      assert (
          "tensorflow_version and pytorch_version are both not None."
          in str(error)
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/huggingface/test_estimator.py
imports: from __future__ import absolute_import
  import logging
  import json
  import os
  import pytest
  from mock import MagicMock, Mock, patch
  from sagemaker.huggingface import HuggingFace, HuggingFaceModel
  from sagemaker.session_settings import SessionSettings
  from .huggingface_utils import get_full_gpu_image_uri, GPU_INSTANCE_TYPE, REGION
label_desc: Use image node_id 4 for calling a global function with example usage: test_huggingface_invalid_args() without return types