code: def test_seeded_per_batch():
      num_batches = 10
      num_iter = 10
      seed = 0
  
      # different permutations of batch numbers should always give the same seeds
      batch_nums_perms = [
          np.random.permutation(num_batches) for _ in range(num_iter)
      ]
  
      def get_batches(batch_nums):
          s = SeededPerBatch(create_with_seed=lambda x: x, seed=seed)
          batches = [0] * num_batches
  
          for batch_num in batch_nums:
              batches[batch_num] = s[batch_num]
  
          return tuple(batches)
  
      assert (
          len(
              {
                  get_batches(batch_nums)
                  for batch_nums in batch_nums_perms
              }
          )
          == 1
      )
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_seeded_per_batch() and returns: tuple