code: def _time_warmup_and_work_tf(
      reader,
      warmup_cycles_count,
      measure_cycles_count,
      shuffling_queue_size,
      min_after_dequeue,
  ):
      with tf.Session() as sess:
          sess.run(
              [
                  tf.global_variables_initializer(),
                  tf.local_variables_initializer(),
              ]
          )
  
          readout_tensors = tf_tensors(
              reader, shuffling_queue_size, min_after_dequeue
          )
  
          coord = tf.train.Coordinator()
          threads = tf.train.start_queue_runners(
              coord=coord, start=True, sess=sess
          )
  
          result = _time_warmup_and_work(
              reader,
              warmup_cycles_count,
              measure_cycles_count,
              lambda: sess.run(readout_tensors),
          )
  
          coord.request_stop()
          coord.join(threads)
  
      return result
  
imports: from __future__ import division
  import copy
  import logging
  import time
  from collections import namedtuple
  from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
  from enum import Enum
  import psutil
  import six
  import tensorflow.compat.v1
  from petastorm import make_reader
  from petastorm.etl.dataset_metadata import get_schema_from_dataset_url
  from petastorm.reader_impl.pickle_serializer import PickleSerializer
  from petastorm.tf_utils import tf_tensors
  from petastorm.unischema import match_unischema_fields
  from petastorm.workers_pool.dummy_pool import DummyPool
  from petastorm.workers_pool.process_pool import ProcessPool
  from petastorm.workers_pool.thread_pool import ThreadPool
label_desc: Use image node_id 2 for calling a global function with example usage: _time_warmup_and_work_tf(reader, warmup_cycles_count, measure_cycles_count, shuffling_queue_size, min_after_dequeue) and returns: result