code: def test_fail_sequence_rearrange():
      shape = [5, 1]
      orders = [
          ([6, 7], False),
          ([-1], False),
          ([], False),
          ([np.int32([0]), np.int32([])], True),
          ([np.int32([6, 7]), np.int32([0])], True),
          ([np.int32([-1]), np.int32([0])], True),
          ([np.int32([[1], [2]]), np.int32([[1], [2]])], True),
      ]
      error_msgs = [
          "new_order[[]*[]] must be between * and input_sequence_length = * for sample *, but it is: *",  # noqa:E501
          "new_order[[]*[]] must be between * and input_sequence_length = * for sample *, but it is: *",  # noqa:E501
          "Empty result sequences are not allowed",
          "Empty `new_order` for sample * is not allowed",
          "new_order[[]*[]] must be between * and input_sequence_length = * for sample *, but it is: *",  # noqa:E501
          "new_order[[]*[]] must be between * and input_sequence_length = * for sample *, but it is: *",  # noqa:E501
          "Input with dimension * cannot be converted to dimension *",
      ]
  
      assert len(orders) == len(error_msgs)
  
      for dev in ["cpu", "gpu"]:
          for [new_order, per_sample], error_msg in zip(
              orders, error_msgs
          ):
              yield raises(RuntimeError, glob=error_msg)(
                  check_fail_sequence_rearrange
              ), 2, shape, new_order, per_sample, dev
  
file_path: DALI/dali/test/python/operator_2/test_sequence_rearrange.py
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.fn
  import numpy
  from nose_utils import raises
label_desc: Use image node_id 9 for calling a global function with example usage: test_fail_sequence_rearrange() without return types