code: def main(data_dir):
      print("Download from {} and extract.".format(CIFAR_DOWNLOAD_URL))
      download_and_extract(data_dir)
      file_names = _get_file_names()
      input_dir = os.path.join(data_dir, CIFAR_LOCAL_FOLDER)
      for mode, files in file_names.items():
          input_files = [os.path.join(input_dir, f) for f in files]
          output_file = os.path.join(data_dir, mode + ".tfrecords")
          try:
              os.remove(output_file)
          except OSError:
              pass
          # Convert to tf.train.Example and write the to TFRecords.
          convert_to_tfrecord(input_files, output_file)
      print("Done!")
  
file_path: dragonfly/examples/nas/cg/cifar/generate_cifar10_tfrecords.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import cPickle
  import os
  import tarfile
  from six.moves import xrange
  import tensorflow
label_desc: Use image node_id 7 for calling a global function with example usage: main(data_dir) without return types