code: def test_mask_positions(keep_frac) -> None:
      opts = argparse.Namespace()
      setattr(
          opts, "image_augmentation.mask_positions.keep_frac", keep_frac
      )
      setattr(opts, "dev.device", "cpu")
  
      t = image_bytes.MaskPositions(opts)
  
      size = 32
      samples = torch.randint(255, [size])
      x = {"samples": samples.clone()}
      out = t(x)["samples"]
      assert out.shape == (keep_frac * size,)
  
file_path: ml-cvnets/tests/transforms/test_image_bytes.py
imports: import argparse
  from typing import Tuple
  import pytest
  import torch
  from data.transforms import image_bytes
label_desc: Use image node_id 3 for calling a global function with example usage: test_mask_positions(keep_frac) without return types