code: def _prepare_babi_data(tmp_dir, data_dir):
      """Downloads and extracts the dataset.
  
      Args:
        tmp_dir: temp directory to download and extract the dataset
        data_dir: The base directory where data and vocab files are stored.
  
      Returns:
        tmp_dir: temp directory containing the raw data.
      """
      if not tf.gfile.Exists(data_dir):
          tf.gfile.MakeDirs(data_dir)
  
      file_path = os.path.join(tmp_dir, _TAR)
      headers = {
          "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) "
          "AppleWebKit/537.36 (KHTML, like Gecko) "
          "Chrome/63.0.3239.132 Safari/537.36"
      }
      resp = requests.get(_URL, headers=headers)
      with open(file_path, "wb") as f:
          f.write(resp.content)
  
      tar = tarfile.open(file_path)
      tar.extractall(tmp_dir)
      tar.close()
  
      return tmp_dir
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import shutil
  import tarfile
  import requests
  import six
  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 tokenizer
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: _prepare_babi_data(tmp_dir, data_dir) and returns: tmp_dir