code: def _create_strategy_and_mid_level(
      self, optimizer_name
  ) -> Tuple[
      tpu_strategy.TPUStrategy,
      tpu_embedding_v2.TPUEmbedding,
      tpu_embedding_v2_utils._Optimizer,
  ]:
      strategy = self._get_strategy()
  
      with strategy.scope():
          if optimizer_name == "sgd":
              optimizer = tpu_embedding_v2_utils.SGD(learning_rate=0.1)
          elif optimizer_name == "adagrad":
              optimizer = tpu_embedding_v2_utils.Adagrad(
                  learning_rate=0.1
              )
          elif optimizer_name == "adam":
              optimizer = tpu_embedding_v2_utils.Adam(learning_rate=0.1)
          elif optimizer_name == "ftrl":
              optimizer = tpu_embedding_v2_utils.FTRL(learning_rate=0.1)
          elif optimizer_name == "adagrad_momentum":
              optimizer = tpu_embedding_v2_utils.AdagradMomentum(
                  learning_rate=0.1,
                  momentum=0.9,
                  use_nesterov=True,
                  exponent=3.0,
                  epsilon=0.1,
                  beta2=0.9,
              )
          else:
              raise ValueError(
                  "optimizer is not recognized: ", optimizer_name
              )
          mid_level_api = self._create_mid_level(optimizer=optimizer)
  
      return strategy, mid_level_api, optimizer
  
imports: import os
  from typing import Tuple
  from absl import flags
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import tpu_strategy
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.eager import remote
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import init_ops_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import tpu_embedding_v2
  from tensorflow.python.tpu import tpu_embedding_v2_utils
  from tensorflow.python.util import nest
label_desc: Use image node_id 6 for calling the TPUEmbeddingBaseTest obj's underlying member method code with example usage: obj._create_strategy_and_mid_level(optimizer_name) and returns: strategy,  mid_level_api,  optimizer