code: def test_randomapply():
      transfo = T.RandomApply(lambda x: 1 - x)
      out = transfo(1)
      assert out == 0 or out == 1
      transfo = T.RandomApply(lambda x, y: (1 - x, 2 * y))
      out = transfo(1, np.array([2]))
      assert (
          out == (0, 4)
          or out == (1, 2)
          and isinstance(out[1], np.ndarray)
      )
      assert repr(transfo).endswith(", p=0.5)")
  
file_path: doctr/tests/common/test_transforms.py
imports: import numpy
  import pytest
  from doctr.transforms import modules
  from doctr.transforms.functional.base import expand_line
label_desc: Use image node_id 4 for calling a global function with example usage: test_randomapply() without return types