code: def generate_data_with_shared_vocab(self, data_dir, tmp_dir, task_id=-1):
      
      global_vocab_filename = os.path.join(data_dir, self.vocab_filename)
      if not tf.gfile.Exists(global_vocab_filename):
        raise ValueError(
            'Global vocabulary file: %s does not exist, '
            'please create one using build_vocab.py' % global_vocab_filename)
      # Before generating data, we copy the global vocabulary file to the children
      # locations. Although this is not the most disk efficient strategy, it
      # imposes the fewest changes to the text-to-text API.
      for p in self.problems:
        local_vocab_filename = os.path.join(data_dir, p.vocab_filename)
        if not tf.gfile.Exists(local_vocab_filename):
          tf.gfile.Copy(global_vocab_filename, local_vocab_filename)
        p.generate_data(data_dir, tmp_dir, task_id)
docs: Generates TF-Records for problems using a global vocabulary file.