code: def test_is_leaf():
      a = Categorical([1, 2, 3], label="a")
  
      with pytest.raises(
          ValueError, match=r"is_leaf\(\) should return"
      ):
          a.simplify(is_leaf=lambda x: False)
  
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 10 for calling a global function with example usage: test_is_leaf() without return types