code: def _extract_training_config_from_estimator(
      tuner, inputs, include_cls_metadata, mini_batch_size
  ):
      """Extract training job config from a HyperparameterTuner that uses the ``estimator`` field"""
      train_config = training_base_config(
          tuner.estimator, inputs, mini_batch_size
      )
      train_config.pop("HyperParameters", None)
  
      tuner._prepare_static_hyperparameters_for_tuning(
          include_cls_metadata=include_cls_metadata
      )
      train_config[
          "StaticHyperParameters"
      ] = tuner.static_hyperparameters
  
      if tuner.metric_definitions:
          train_config["AlgorithmSpecification"][
              "MetricDefinitions"
          ] = tuner.metric_definitions
  
      s3_operations = train_config.pop("S3Operations", None)
      return train_config, s3_operations
  
imports: from __future__ import print_function, absolute_import
  import os
  import re
  import sagemaker
  from sagemaker import fw_utils, job, utils, s3, session, vpc_utils
  from sagemaker.amazon import amazon_estimator
  from sagemaker.tensorflow import TensorFlow
  from sagemaker.estimator import EstimatorBase
  from sagemaker.processing import Processor
  from sagemaker.utils import format_tags
label_desc: Use image node_id 7 for calling a global function with example usage: _extract_training_config_from_estimator(tuner, inputs, include_cls_metadata, mini_batch_size) and returns: train_config,  s3_operations