def METHOD_NAME():
  # First pass: extract transcription files.
  if os.path.exists(FLAGS.transcripts_filepath):
    trans = _LoadTranscriptionsFromFile()
  else:
    tf.logging.info('Running first pass on the fly')
    trans = _ReadTranscriptions()
  tf.logging.info('Total transcripts: %d', len(trans))
  tf_bytes = tf.placeholder(dtype=tf.string)
  log_mel = audio_lib.ExtractLogMelFeatures(tf_bytes)
  # Second pass: transcode the flac.
  tar = tarfile.open(FLAGS.input_tarball, mode='r:gz')
  n = 0
  recordio_writers = _OpenSubShards()
  tfconf = tf.config_pb2.ConfigProto()
  tfconf.gpu_options.allow_growth = True
  with tf.Session(config=tfconf) as sess:
    for tarinfo in tar:
      if not tarinfo.name.endswith('.flac'):
        continue
      n += 1
      if n % FLAGS.num_shards != FLAGS.shard_id:
        continue
      uttid = re.sub('.*/(.+)\\.flac', '\\1', tarinfo.name)
      uttid = uttid.encode('utf-8')
      f = tar.extractfile(tarinfo)
      wav_bytes = audio_lib.DecodeFlacToWav(f.read())
      f.close()
      frames = sess.run(log_mel, feed_dict={tf_bytes: wav_bytes})
      assert uttid in trans, uttid
      num_words = len(trans[uttid])
      tf.logging.info('utt[%d]: %s [%d frames, %d words]', n, uttid,
                           frames.shape[1], num_words)
      ex = _MakeTfExample(uttid, frames, trans[uttid])
      outf = _SelectRandomShard(recordio_writers)
      outf.write(ex.SerializeToString())
    tar.close()
  _CloseSubShards(recordio_writers)