code: def _get_model_fn(self):
      def _model_fn(features, labels, mode, params):
          del labels
          del params
  
          flag = tf.Variable(initial_value=False, collections=[])
          set_flag = tf.assign(flag, True)
          test_flag = tf.debugging.Assert(tf.equal(flag, True), [flag])
  
          scaffold = tf.train.Scaffold(
              local_init_op=tf.group(
                  tf.train.Scaffold.default_local_init_op(), set_flag
              )
          )
  
          # Note: Not consuming the feature stales the test input_fn.
          feature = next(iter(features.values()))
          with tf.control_dependencies([feature, test_flag]):
              batch_size = tf.shape(feature)[0]
              predictions = tf.zeros([batch_size, 1])
  
          return tf.estimator.EstimatorSpec(
              mode,
              loss=tf.constant(-1.0),
              train_op=test_flag,
              scaffold=scaffold,
              predictions=predictions,
          )
  
      return _model_fn
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import os
  import shutil
  import sys
  from absl import flags
  from absl import logging
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.autoensemble.common import AutoEnsembleSubestimator
  from adanet.autoensemble.estimator import _GeneratorFromCandidatePool
  from adanet.autoensemble.estimator import AutoEnsembleEstimator
  import tensorflow.compat.v1
  from tensorflow.python.estimator.export import export
label_desc: Use image node_id 2 for calling the CheckLocalInitOpEstimator obj's underlying member method code with example usage: obj._get_model_fn() and returns: _model_fn, tf