code: def test_algorithm_trainining_channels_with_expected_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,
      )
  
      # Pass training and validation channels. This should work
      estimator.fit(
          {
              "training": "s3://some/place",
              "validation": "s3://some/other",
          }
      )
  
      # Passing only the training channel. Validation is optional so this should also work.
      estimator.fit({"training": "s3://some/place"})
  
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 3 for calling a global function with example usage: test_algorithm_trainining_channels_with_expected_channels(session) without return types