code: def test_training_step_tensorflow(sagemaker_session):
      instance_type_parameter = ParameterString(
          name="InstanceType", default_value="ml.p3.16xlarge"
      )
      instance_count_parameter = ParameterInteger(
          name="InstanceCount", default_value=1
      )
      data_source_uri_parameter = ParameterString(
          name="DataSourceS3Uri",
          default_value=f"s3://{BUCKET}/train_manifest",
      )
      training_epochs_parameter = ParameterInteger(
          name="TrainingEpochs", default_value=5
      )
      training_batch_size_parameter = ParameterInteger(
          name="TrainingBatchSize", default_value=500
      )
      estimator = TensorFlow(
          entry_point=DUMMY_SCRIPT_PATH,
          role=ROLE,
          model_dir=False,
          image_uri=IMAGE_URI,
          source_dir="s3://mybucket/source",
          framework_version="2.4.1",
          py_version="py37",
          instance_count=instance_count_parameter,
          instance_type=instance_type_parameter,
          sagemaker_session=sagemaker_session,
          hyperparameters={
              "batch-size": training_batch_size_parameter,
              "epochs": training_epochs_parameter,
          },
          debugger_hook_config=False,
          # Training using SMDataParallel Distributed Training Framework
          distribution={
              "smdistributed": {"dataparallel": {"enabled": True}}
          },
      )
  
      inputs = TrainingInput(s3_data=data_source_uri_parameter)
      cache_config = CacheConfig(
          enable_caching=True, expire_after="PT1H"
      )
      step = TrainingStep(
          name="MyTrainingStep",
          estimator=estimator,
          inputs=inputs,
          cache_config=cache_config,
      )
      pipeline = Pipeline(
          name="MyPipeline",
          parameters=[
              instance_type_parameter,
              instance_count_parameter,
              data_source_uri_parameter,
              training_epochs_parameter,
              training_batch_size_parameter,
          ],
          steps=[step],
          sagemaker_session=sagemaker_session,
      )
      dsl = json.loads(pipeline.definition())["Steps"][0]
      dsl["Arguments"]["HyperParameters"].pop("sagemaker_program", None)
      dsl["Arguments"].pop("ProfilerRuleConfigurations", None)
      assert dsl == {
          "Name": "MyTrainingStep",
          "Type": "Training",
          "Arguments": {
              "AlgorithmSpecification": {
                  "TrainingInputMode": "File",
                  "TrainingImage": "fakeimage",
                  "EnableSageMakerMetricsTimeSeries": True,
              },
              "OutputDataConfig": {"S3OutputPath": "s3://my-bucket/"},
              "StoppingCondition": {"MaxRuntimeInSeconds": 86400},
              "ResourceConfig": {
                  "InstanceCount": {"Get": "Parameters.InstanceCount"},
                  "InstanceType": {"Get": "Parameters.InstanceType"},
                  "VolumeSizeInGB": 30,
              },
              "RoleArn": "DummyRole",
              "InputDataConfig": [
                  {
                      "DataSource": {
                          "S3DataSource": {
                              "S3DataType": "S3Prefix",
                              "S3Uri": {
                                  "Get": "Parameters.DataSourceS3Uri"
                              },
                              "S3DataDistributionType": "FullyReplicated",
                          }
                      },
                      "ChannelName": "training",
                  }
              ],
              "HyperParameters": {
                  "batch-size": {
                      "Std:Join": {
                          "On": "",
                          "Values": [
                              {"Get": "Parameters.TrainingBatchSize"}
                          ],
                      }
                  },
                  "epochs": {
                      "Std:Join": {
                          "On": "",
                          "Values": [
                              {"Get": "Parameters.TrainingEpochs"}
                          ],
                      }
                  },
                  "sagemaker_submit_directory": '"s3://mybucket/source"',
                  "sagemaker_container_log_level": "20",
                  "sagemaker_region": '"us-west-2"',
                  "sagemaker_distributed_dataparallel_enabled": "true",
                  "sagemaker_instance_type": {
                      "Get": "Parameters.InstanceType"
                  },
                  "sagemaker_distributed_dataparallel_custom_mpi_options": '""',
              },
              "ProfilerConfig": {
                  "DisableProfiler": False,
                  "S3OutputPath": "s3://my-bucket/",
              },
          },
          "CacheConfig": {"Enabled": True, "ExpireAfter": "PT1H"},
      }
      assert step.properties.TrainingJobName.expr == {
          "Get": "Steps.MyTrainingStep.TrainingJobName"
      }
  
imports: from __future__ import absolute_import
  import json
  import pytest
  import os
  import warnings
  from mock import patch
  from sagemaker.debugger import ProfilerConfig
  from sagemaker.estimator import Estimator
  from sagemaker.tensorflow import TensorFlow
  from sagemaker.inputs import TrainingInput, TransformInput, CreateModelInput
  from sagemaker.model import Model
  from sagemaker.processing import Processor, ProcessingInput, ProcessingOutput, ScriptProcessor
  from sagemaker.tuner import HyperparameterTuner, ContinuousParameter, WarmStartConfig, WarmStartTypes
  from sagemaker.network import NetworkConfig
  from sagemaker.transformer import Transformer
  from sagemaker.workflow.functions import Join, JsonGet
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.properties import PropertyFile
  from sagemaker.workflow.parameters import ParameterString, ParameterInteger, ParameterBoolean
  from sagemaker.workflow.retry import StepRetryPolicy, StepExceptionTypeEnum, SageMakerJobStepRetryPolicy, SageMakerJobExceptionTypeEnum
  from sagemaker.workflow.steps import ProcessingStep, TrainingStep, TuningStep, TransformStep, CreateModelStep, CacheConfig
  from sagemaker.pipeline import PipelineModel
  from sagemaker.sparkml import SparkMLModel
  from sagemaker.predictor import Predictor
  from sagemaker.model import FrameworkModel
  from tests.unit import DATA_DIR
  from tests.unit.sagemaker.workflow.helpers import ordered, CustomStep
label_desc: Use image node_id 8 for calling a global function with example usage: test_training_step_tensorflow(sagemaker_session) without return types