code: def test_algorithm_no_required_hyperparameters(session):
      session.sagemaker_config = {}
      some_algo = copy.deepcopy(DESCRIBE_ALGORITHM_RESPONSE)
      del some_algo["TrainingSpecification"]["SupportedHyperParameters"]
  
      session.sagemaker_client.describe_algorithm = Mock(
          return_value=some_algo
      )
  
      # Calling AlgorithmEstimator() with unset required hyperparameters
      # should fail if they are required.
      # Pass training and hyperparameters channels. This should work
      assert AlgorithmEstimator(
          algorithm_arn="arn:aws:sagemaker:us-east-2:1234:algorithm/scikit-decision-trees",
          role="SageMakerRole",
          instance_type="ml.m4.2xlarge",
          instance_count=1,
          sagemaker_session=session,
      )
  
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 22 for calling a global function with example usage: test_algorithm_no_required_hyperparameters(session) without return types