code: def test_random():
      lst = MutableList(
          [
              Categorical([1, 2, 3]),
              Numerical(4, 6, label="z"),
              Numerical(4, 6, log_distributed=True),
              Numerical(mu=0, sigma=1),
              Numerical(4, 6, label="z"),
          ]
      )
  
      assert lst.random(
          random_state=np.random.RandomState(0)
      ) == lst.random(random_state=np.random.RandomState(0))
      sample = lst.random(random_state=np.random.RandomState(0))
      assert sample[1] == sample[4]
  
      x = Categorical([1, 2, 3], label="x", default=2)
      y = Categorical([4, 5, 6], label="y", default=4)
      with pytest.raises(ConstraintViolation):
          for _ in range(50):
              ExpressionConstraint(x + y == 7).random()
  
imports: import math
  from collections import Counter
  import numpy
  import pytest
  from nni.mutable import *
  from nni.mutable.mutable import _dedup_labeled_mutables, _mutable_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_random() without return types