code: def test_abs():
      X = Uniform(0, 1).rv  # (0, 1)
      X = 2 * (X - 0.5)  # (-1, 1)
      X = abs(X)  # (0, 1)
      x = X.dist.sample([N_SAMPLES])
      assert ((0 <= x) & (x <= 1)).all().item()
  
file_path: pyro/tests/contrib/randomvariable/test_random_variable.py
imports: import math
  import torch
  from pyro.distributions import Uniform
label_desc: Use image node_id 4 for calling a global function with example usage: test_abs() without return types