code: def _test_random_token_mask(
      self, seed=0, mask_ratio=0.6, mask_class_token=False, device="cpu"
  ):
      torch.manual_seed(seed)
      batch_size, seq_length = 2, 5
      idx_keep, idx_mask = utils.random_token_mask(
          size=(batch_size, seq_length),
          mask_ratio=mask_ratio,
          mask_class_token=mask_class_token,
          device=device,
      )
  
      # concatenating and sorting the two index tensors should result in a tensor
      # with every index appearing exactly once
      idx, _ = torch.cat([idx_keep, idx_mask], dim=1).sort(dim=1)
      expected_idx = (
          torch.arange(seq_length)
          .repeat(batch_size)
          .reshape(batch_size, seq_length)
      )
      expected_idx = expected_idx.to(device)
      self._assert_tensor_equal(idx, expected_idx)
  
      if not mask_class_token:
          # class token should be first in index
          self.assertTrue(torch.all(idx_keep[:, 0] == 0))
  
imports: import copy
  import unittest
  import torch
  import torch.nn
  from lightly.models import utils
  from lightly.models.utils import _no_grad_trunc_normal, activate_requires_grad, batch_shuffle, batch_unshuffle, deactivate_requires_grad, nearest_neighbors, normalize_weight, update_momentum
label_desc: Use image node_id 15 for calling the TestModelUtils obj's underlying member method code with example usage: obj._test_random_token_mask(seed, mask_ratio, mask_class_token, device) without return types