code: def setup_class(self):
      self._cwd = getcwd()
      self._temp_dir = mkdtemp()
      # step into temp directory as working directory
      # to make the user-facing examples cleaner
      chdir(self._temp_dir)
  
      # create toy models for conversion examples
      import tensorflow as tf
  
      # write a toy tf.keras HDF5 model
      tf_keras_model = tf.keras.Sequential(
          [
              tf.keras.layers.Flatten(input_shape=(28, 28)),
              tf.keras.layers.Dense(128, activation=tf.nn.relu),
              tf.keras.layers.Dense(10, activation=tf.nn.softmax),
          ]
      )
      tf_keras_model.save("./tf_keras_model.h5")
  
      # write a toy SavedModel directory
      tf_keras_model.save("./saved_model", save_format="tf")
  
imports: from os import getcwd, chdir
  from shutil import rmtree
  from os.path import exists
  from tempfile import mkdtemp
  import pytest
  import numpy
  import coremltools
  import os
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH, MSG_TF1_NOT_FOUND, MSG_TF2_NOT_FOUND, MSG_TORCH_NOT_FOUND
label_desc: Use image node_id 1 for calling the TestTensorFlow2ConverterExamples obj's underlying member method code with example usage: obj.setup_class() without return types