code: def test_algorithm_trainining_channels_with_invalid_channels(session):
      session.sagemaker_config = {}
      training_channels = copy.deepcopy(DESCRIBE_ALGORITHM_RESPONSE)
  
      training_channels["TrainingSpecification"]["TrainingChannels"] = [
          {
              "Name": "training",
              "Description": "Input channel that provides training data",
              "IsRequired": True,
              "SupportedContentTypes": ["text/csv"],
              "SupportedCompressionTypes": ["None"],
              "SupportedInputModes": ["File"],
          },
          {
              "Name": "validation",
              "Description": "Input channel that provides validation data",
              "IsRequired": False,
              "SupportedContentTypes": ["text/csv"],
              "SupportedCompressionTypes": ["None"],
              "SupportedInputModes": ["File"],
          },
      ]
  
      session.sagemaker_client.describe_algorithm = Mock(
          return_value=training_channels
      )
  
      estimator = AlgorithmEstimator(
          algorithm_arn="arn:aws:sagemaker:us-east-2:1234:algorithm/scikit-decision-trees",
          role="SageMakerRole",
          instance_type="ml.m4.xlarge",
          instance_count=1,
          sagemaker_session=session,
      )
  
      # Passing only validation should fail as training is required.
      with pytest.raises(ValueError):
          estimator.fit({"validation": "s3://some/thing"})
  
      # Passing an unknown channel should fail???
      with pytest.raises(ValueError):
          estimator.fit(
              {
                  "training": "s3://some/data",
                  "training2": "s3://some/other/data",
              }
          )
  
imports: from __future__ import absolute_import
  import copy
  import datetime
  import pytest
  from mock import Mock, patch
  from sagemaker.algorithm import AlgorithmEstimator
  from sagemaker.estimator import _TrainingJob
  from sagemaker.transformer import Transformer
label_desc: Use image node_id 4 for calling a global function with example usage: test_algorithm_trainining_channels_with_invalid_channels(session) without return types