code: def _maybe_download_corpora(tmp_dir, dataset_split):
      """Download corpora if necessary and unzip them.
  
      Args:
        tmp_dir: directory containing dataset.
        dataset_split: whether we're in train/dev/test mode.
  
      Returns:
        List of all files generated and path to file containing
          train/dev/test split info.
      """
      cnn_filename = "cnn_stories.tgz"
      cnn_finalpath = os.path.join(tmp_dir, "cnn/stories/")
      dailymail_filename = "dailymail_stories.tgz"
      dailymail_finalpath = os.path.join(tmp_dir, "dailymail/stories/")
      if not tf.gfile.Exists(cnn_finalpath):
          cnn_file = generator_utils.maybe_download_from_drive(
              tmp_dir, cnn_filename, _CNN_STORIES_DRIVE_URL
          )
          with tarfile.open(cnn_file, "r:gz") as cnn_tar:
              cnn_tar.extractall(tmp_dir)
      if not tf.gfile.Exists(dailymail_finalpath):
          dailymail_file = generator_utils.maybe_download_from_drive(
              tmp_dir, dailymail_filename, _DAILYMAIL_STORIES_DRIVE_URL
          )
          with tarfile.open(dailymail_file, "r:gz") as dailymail_tar:
              dailymail_tar.extractall(tmp_dir)
  
      cnn_files = tf.gfile.Glob(cnn_finalpath + "*")
      dailymail_files = tf.gfile.Glob(dailymail_finalpath + "*")
      all_files = cnn_files + dailymail_files
  
      if dataset_split == problem.DatasetSplit.TRAIN:
          urls_path = generator_utils.maybe_download(
              tmp_dir, "all_train.txt", _TRAIN_URLS
          )
      elif dataset_split == problem.DatasetSplit.EVAL:
          urls_path = generator_utils.maybe_download(
              tmp_dir, "all_val.txt", _DEV_URLS
          )
      else:
          urls_path = generator_utils.maybe_download(
              tmp_dir, "all_test.txt", _TEST_URLS
          )
  
      return all_files, urls_path
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import hashlib
  import io
  import os
  import random
  import tarfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators import wiki_lm
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_download_corpora(tmp_dir, dataset_split) and returns: all_files,  urls_path