code: def test_shuffle_audios_single_cycle_permutation(
      numel: int, is_training: bool
  ) -> None:
      device = torch.device("cpu")
      prev_perm = ShuffleAudios._single_cycle_permutation(
          numel, device=device, is_training=is_training
      )
      identity = torch.arange(numel, device=device)
      is_random = False
      for _ in range(20):
          perm = ShuffleAudios._single_cycle_permutation(
              numel, device=device, is_training=is_training
          )
          if torch.any(perm != prev_perm):
              is_random = True
              prev_perm = perm
  
          assert torch.all(
              perm != identity
          ), f"Single cycle permutation should not have identity mapping: {perm}."
  
          sorted_perm, _ = perm.sort()
          assert torch.all(
              sorted_perm == identity
          ), f"Result is not a permutation: {perm}."
  
      assert (
          is_random == is_training
      ), "Outcomes should be random iff is_training."
  
file_path: ml-cvnets/tests/transforms/test_video.py
imports: import operator
  import os
  from pathlib import Path
  from typing import Dict, Tuple
  import pytest
  import torch
  from data.transforms.video import CropByBoundingBox, SaveInputs, ShuffleAudios, _resize_fn
  from data.video_reader.pyav_reader import PyAVReader
  from tests.configs import get_config
label_desc: Use image node_id 3 for calling a global function with example usage: test_shuffle_audios_single_cycle_permutation(numel, is_training) without return types