def generate_samples(self, data_dir, tmp_dir, dataset_split):
    """Downloads and extracts the dataset and generates examples.

    Args:
      data_dir: The base directory where data and vocab files are stored.
      tmp_dir: temp directory to download and extract the dataset.
      dataset_split: split of the data-set.

    Yields:
      The data examples.
    """
    if not tf.gfile.Exists(tmp_dir):
      tf.gfile.MakeDirs(tmp_dir)

    if not tf.gfile.Exists(data_dir):
      tf.gfile.MakeDirs(data_dir)

    # Download and extract.
    download_path = _download_mlu_data(tmp_dir, data_dir)
    filepath = os.path.join(download_path, "symbolic_math_train.txt")
    with open(filepath, "r") as fp:
      for l in fp:
        prob, ans = l.strip().split(":")
        yield {"inputs": prob, "targets": ans}
Downloads and extracts the dataset and generates examples.

    Args:
      data_dir: The base directory where data and vocab files are stored.
      tmp_dir: temp directory to download and extract the dataset.
      dataset_split: split of the data-set.

    Yields:
      The data examples.
    
tensor2tensor/data_generators/algorithmic_math_two_variables.py