code: def test_parallel_data_set_permute(include_prepended_source_length):
      batch_size = 5
      buckets = data_io.define_parallel_buckets(100, 100, 10, True, 1.0)
      bucket_batch_sizes = data_io.define_bucket_batch_sizes(
          buckets,
          batch_size,
          batch_type=C.BATCH_TYPE_SENTENCE,
          data_target_average_len=[None] * len(buckets),
      )
      dataset = data_io.ParallelDataSet(
          *_get_random_bucketed_data(
              buckets,
              min_count=0,
              max_count=5,
              include_prepended_source_length=include_prepended_source_length,
          )
      ).fill_up(bucket_batch_sizes)
  
      permutations, inverse_permutations = data_io.get_permutations(
          dataset.get_bucket_counts()
      )
  
      assert (
          len(permutations) == len(inverse_permutations) == len(dataset)
      )
      dataset_restored = dataset.permute(permutations).permute(
          inverse_permutations
      )
      assert len(dataset) == len(dataset_restored)
      for buck_idx in range(len(dataset)):
          num_samples = dataset.source[buck_idx].shape[0]
          if num_samples:
              assert (
                  dataset.source[buck_idx]
                  == dataset_restored.source[buck_idx]
              ).all()
              assert (
                  dataset.target[buck_idx]
                  == dataset_restored.target[buck_idx]
              ).all()
              if include_prepended_source_length:
                  assert (
                      dataset.prepended_source_length[buck_idx]
                      == dataset_restored.prepended_source_length[
                          buck_idx
                      ]
                  ).all()
          else:
              assert not dataset_restored.source[buck_idx].shape[0]
              assert not dataset_restored.target[buck_idx].shape[0]
              if include_prepended_source_length:
                  assert not dataset_restored.prepended_source_length[
                      buck_idx
                  ].shape[0]
  
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 18 for calling a global function with example usage: test_parallel_data_set_permute(include_prepended_source_length) without return types