code: def might_create_dataset(
      prefix, file, shuffle=False, suffix="**/*.xml"
  ):
      # load data
      data = []
      labels = set()
      annotations_dir = os.path.join(
          ILSVRC_DIR, "Annotations", "CLS-LOC", prefix
      )
      data_dir = os.path.join(ILSVRC_DIR, "Data", "CLS-LOC", prefix)
      for filename in tf.gfile.Glob(
          os.path.join(annotations_dir, suffix)
      ):
          image_path, image_labels = get_data_sample(
              filename, annotations_dir, data_dir
          )
          if image_path is not None and len(image_labels) > 0:
              data.append([image_path] + image_labels)
              for label in image_labels:
                  labels.add(label)
      if shuffle:
          random.shuffle(data)
      # write data
      with tf.gfile.Open(file, "w") as f:
          for d in data:
              f.write("{}\n".format(",".join(d)))
      return sorted(labels)
  
imports: import argparse
  import logging
  import multiprocessing
  import os
  import random
  import sys
  import time
  from xml.etree import ElementTree
  import numpy
  import tensorflow
  from tensorflow.contrib import slim
  from tensorflow.contrib.slim.python.slim.nets.inception_v3 import inception_v3, inception_v3_arg_scope
  from tensorflow.python.framework.errors_impl import OutOfRangeError
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training.basic_session_run_hooks import StopAtStepHook
  from tensorflow.python.training.monitored_session import SingularMonitoredSession
  import tensorlayer
label_desc: Use image node_id 2 for calling a global function with example usage: might_create_dataset(prefix, file, shuffle, suffix) and returns: sorted