code: def get_validation_data_iter(data_loader: RawParallelDatasetLoader,
                               validation_sources: List[str],
                               validation_target: str,
                               buckets: List[Tuple[int, int]],
                               bucket_batch_sizes: List[BucketBatchSize],
                               source_vocabs: List[vocab.Vocab],
                               target_vocab: vocab.Vocab,
                               max_seq_len_source: int,
                               max_seq_len_target: int,
                               batch_size: int) -> 'ParallelSampleIter':
      
      logger.info("=================================")
      logger.info("Creating validation data iterator")
      logger.info("=================================")
      validation_length_statistics = analyze_sequence_lengths(validation_sources, validation_target,
                                                              source_vocabs, target_vocab,
                                                              max_seq_len_source, max_seq_len_target)
  
      check_condition(validation_length_statistics.num_sents > 0,
                      "No validation sequences found with length smaller or equal than the maximum sequence length."
                      "Consider increasing %s" % C.TRAINING_ARG_MAX_SEQ_LEN)
  
      validation_sources_sentences, validation_target_sentences = create_sequence_readers(validation_sources,
                                                                                          validation_target,
                                                                                          source_vocabs, target_vocab)
  
      validation_data_statistics = get_data_statistics(validation_sources_sentences,
                                                       validation_target_sentences,
                                                       buckets,
                                                       validation_length_statistics.length_ratio_mean,
                                                       validation_length_statistics.length_ratio_std,
                                                       source_vocabs, target_vocab)
  
      validation_data_statistics.log(bucket_batch_sizes)
  
      validation_data = data_loader.load(validation_sources_sentences, validation_target_sentences,
                                         validation_data_statistics.num_sents_per_bucket).fill_up(bucket_batch_sizes)
  
      return ParallelSampleIter(data=validation_data,
                                buckets=buckets,
                                batch_size=batch_size,
                                bucket_batch_sizes=bucket_batch_sizes,
                                num_factors=len(validation_sources))
docs: Returns a ParallelSampleIter for the validation data.