def data_pipeline_status(self, train_mode):
    """Check at which part of the pipeline are we at.

    This function first checks recursively at which point in the
    data processing point are we (what files can be found on the disk),
    and then proceeds from there.

    Args:
      train_mode: string, whether we are in train, dev or test mode
    """

    # Build the source and target paths.
    sourcepath = os.path.join(self._data_dir, train_mode + 'Source.txt')
    targetpath = os.path.join(self._data_dir, train_mode + 'Target.txt')

    # If raw data dir doesn't exist, create it.
    if not os.path.exists(self._raw_data_dir):
      os.makedirs(self._raw_data_dir)

    # Check whether sourcePath.txt exists.
    if (os.path.isfile(sourcepath) and os.path.isfile(targetpath) and
        os.path.isfile(os.path.join(self._data_dir, self.vocab_file))):
      print('problem_log: Source, target and vocab files exist in ' +
            self._data_dir + ', proceeding with data generation. ' +
            'If you want to rebuild these files, delete them first.')
      return

    # Check whether the raw data is extracted to the raw_data_dir folder.
    elif os.path.exists(self._raw_data):
      print('problem_log: No source, target or vocab files found in ' +
            self._data_dir + '.')
      print('problem_log: Extracted raw data is in ' + self._raw_data_dir +
            '. Proceeding with creating source, target and vocab files.')
      self.create_data(train_mode)

    # Check whether the data is downloaded in the raw_data_dir_folder.
    elif os.path.exists(self._zipped_data):
      print('problem_log: No source, target or vocab files found in ' +
            self._data_dir + '.')
      print('problem_log: No extracted raw data found in ' +
            self._raw_data_dir + '.')
      print('problem_log: Unextracted raw data is in ' + self._raw_data_dir +
            '. Extracting and creating source, target and vocab files.')
      self.extract_data(train_mode)

    else:
      print('problem_log: No source, target or vocab files found in ' +
            self._data_dir + '.')
      print('problem_log: No raw data found in ' + self._raw_data_dir +
            '. Proceeding with downloading the data, extracting it, ' +
            'and creating source, target and vocab files.')
      self.download_data(train_mode)
Check at which part of the pipeline are we at.

    This function first checks recursively at which point in the
    data processing point are we (what files can be found on the disk),
    and then proceeds from there.

    Args:
      train_mode: string, whether we are in train, dev or test mode
    
tensor2tensor/data_generators/dialog_abstract.py