code: def test_err_classes_weights_length_clash():
      error_msg = (
          r"If both ``classes`` and ``class_weights`` are provided, their shapes must "
          r"match. Got:\s+classes.shape = \{4\}\s+weights.shape = \{3\}"
      )
      with assert_raises(RuntimeError, regex=error_msg):
          _test_err_args(
              classes=[0, 1, 2, 3], class_weights=np.float32([1, 2, 3])
          )
      with assert_raises(RuntimeError, regex=error_msg):
          _test_err_args(
              classes=np.int32([0, 1, 2, 3]), class_weights=[3, 2, 1]
          )
  
imports: from nose_utils import assert_raises
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.ops
  import numpy
  import scipy.ndimage
  import scipy.ndimage.measurements
  import random
  from test_utils import check_batch, np_type_to_dali
  from nose.tools import nottest
  from nose.plugins.attrib import attr
label_desc: Use image node_id 31 for calling a global function with example usage: test_err_classes_weights_length_clash() without return types