code: def test_parallel_data_set(include_prepended_source_length):
      buckets = data_io.define_parallel_buckets(100, 100, 10, True, 1.0)
      (
          source,
          target,
          prepended_source_length,
      ) = _get_random_bucketed_data(
          buckets,
          min_count=0,
          max_count=5,
          include_prepended_source_length=include_prepended_source_length,
      )
  
      def check_equal(tensors1, tensors2):
          assert len(tensors1) == len(tensors2)
          for a1, a2 in zip(tensors1, tensors2):
              assert torch.equal(a1, a2)
  
      with TemporaryDirectory() as work_dir:
          dataset = data_io.ParallelDataSet(
              source, target, prepended_source_length
          )
          fname = os.path.join(work_dir, "dataset")
          dataset.save(fname)
          dataset_loaded = data_io.ParallelDataSet.load(fname)
          check_equal(dataset.source, dataset_loaded.source)
          check_equal(dataset.target, dataset_loaded.target)
          if include_prepended_source_length:
              check_equal(
                  dataset.prepended_source_length,
                  dataset_loaded.prepended_source_length,
              )
          else:
              # Test backward compatibility: with the legacy format (source/target only)
              dataset.save(fname, use_legacy_format=True)
              dataset_loaded = data_io.ParallelDataSet.load(fname)
              check_equal(dataset.source, dataset_loaded.source)
              check_equal(dataset.target, dataset_loaded.target)
  
imports: import os
  import random
  from tempfile import TemporaryDirectory
  from typing import Optional, List, Tuple
  import numpy
  import pytest
  import torch
  from sockeye import constants
  from sockeye import data_io
  from sockeye import utils
  from sockeye import vocab
  from sockeye.test_utils import tmp_digits_dataset
  from sockeye.utils import SockeyeError, get_tokens, seed_rngs
label_desc: Use image node_id 15 for calling a global function with example usage: test_parallel_data_set(include_prepended_source_length) without return types