code: def test_sequences():
      np_rng = np.random.default_rng(12345)
      rng = random.Random(42)
      num_iters = 4
      max_num_frames = 50
      max_batch_size = 12
  
      class TransformsParamsProvider(ParamsProvider):
          def unfold_output_layout(self, layout):
              unfolded = super().unfold_output_layout(layout)
              if unfolded == "**":
                  return ""
              return unfolded
  
      def rand_range(limit):
          return range(rng.randint(1, limit) + 1)
  
      def mt(desc):
          return np.float32(np_rng.uniform(-20, 20, (2, 3)))
  
      def scale(desc):
          return np.array(
              [rng.randint(0, 5), rng.randint(-50, 20)],
              dtype=np.float32,
          )
  
      def shift(desc):
          return np.array(
              [rng.randint(-100, 200), rng.randint(-50, 20)],
              dtype=np.float32,
          )
  
      def shear_angles(desc):
          return np.array(
              [rng.randint(-90, 90), rng.randint(-90, 90)],
              dtype=np.float32,
          )
  
      def angle(desc):
          return np.array(rng.uniform(-180, 180), dtype=np.float32)
  
      def per_frame_input(frame_cb):
          return [
              [
                  np.array(
                      [
                          frame_cb(None)
                          for _ in rand_range(max_num_frames)
                      ],
                      dtype=np.float32,
                  )
                  for _ in rand_range(max_batch_size)
              ]
              for _ in range(num_iters)
          ]
  
      test_cases = [
          (
              fn.transforms.rotation,
              {},
              TransformsParamsProvider([ArgCb("angle", angle, True)]),
              ["cpu"],
          ),
          (
              fn.transforms.rotation,
              {"reverse_order": True},
              TransformsParamsProvider(
                  [
                      ArgCb("center", shift, True),
                      ArgCb("angle", angle, False),
                  ]
              ),
              ["cpu"],
          ),
          (
              fn.transforms.scale,
              {},
              TransformsParamsProvider(
                  [
                      ArgCb("scale", scale, True),
                      ArgCb("center", shift, False),
                  ]
              ),
              ["cpu"],
          ),
          (
              fn.transforms.scale,
              {"center": np.array([-50, 100], dtype=np.float32)},
              TransformsParamsProvider([ArgCb("scale", scale, True)]),
              ["cpu"],
          ),
          (
              fn.transforms.translation,
              {},
              TransformsParamsProvider([ArgCb("offset", shift, True)]),
              ["cpu"],
          ),
          (
              fn.transforms.shear,
              {},
              TransformsParamsProvider(
                  [ArgCb("angles", shear_angles, True)]
              ),
              ["cpu"],
          ),
          (
              fn.transforms.shear,
              {},
              TransformsParamsProvider([ArgCb("shear", shift, True)]),
              ["cpu"],
          ),
          (
              fn.transforms.combine,
              {},
              TransformsParamsProvider(
                  [ArgCb(2, mt, True), ArgCb(1, mt, False)]
              ),
              ["cpu"],
          ),
          (
              fn.transforms.combine,
              {},
              TransformsParamsProvider([ArgCb(1, mt, True)]),
              ["cpu"],
          ),
      ]
      only_with_seq_input_cases = [
          (
              fn.transforms.combine,
              {},
              TransformsParamsProvider(
                  [ArgCb(1, mt, True), ArgCb(2, mt, True)]
              ),
              ["cpu"],
          ),
          (
              fn.transforms.combine,
              {},
              TransformsParamsProvider([ArgCb(1, mt, False)]),
              ["cpu"],
          ),
          (
              fn.transforms.translation,
              {},
              TransformsParamsProvider([ArgCb("offset", shift, False)]),
              ["cpu"],
          ),
          (
              fn.transforms.rotation,
              {"reverse_order": True, "angle": 92.0},
              TransformsParamsProvider([]),
              ["cpu"],
          ),
      ]
  
      seq_cases = test_cases + only_with_seq_input_cases
      main_input = ArgData(
          desc=ArgDesc(0, "F", "", "F**"), data=per_frame_input(mt)
      )
      yield from sequence_suite_helper(
          rng, [main_input], seq_cases, num_iters
      )
  
      # transform the test cases to test the transforms with per-frame args but:
      # 1. with the positional input that does not contain frames
      # 2. without the positional input
      for (
          tested_fn,
          fixed_params,
          params_provider,
          devices,
      ) in test_cases:
          [main_source, *rest_cbs] = params_provider.input_params
          if main_source.desc.expandable_prefix != "F":
              continue
          broadcast_0_pos_case_params = TransformsParamsProvider(
              [ArgCb(0, mt, False), *rest_cbs]
          )
          broadcast_0_pos_case = (
              tested_fn,
              fixed_params,
              broadcast_0_pos_case_params,
              devices,
          )
          if any(
              source.desc.is_positional_arg
              for source in params_provider.input_params
          ):
              cases = [broadcast_0_pos_case]
          else:
              no_pos_case_params = TransformsParamsProvider(rest_cbs)
              no_pos_input_case = (
                  tested_fn,
                  fixed_params,
                  no_pos_case_params,
                  devices,
              )
              cases = [broadcast_0_pos_case, no_pos_input_case]
          per_frame_data = per_frame_input(main_source.cb)
          data_dim = len(per_frame_data[0][0].shape)
          assert data_dim > 0
          data_layout = "F" + "*" * (data_dim - 1)
          main_input = ArgData(
              desc=ArgDesc(main_source.desc.name, "F", "", data_layout),
              data=per_frame_data,
          )
          yield from sequence_suite_helper(
              rng, [main_input], cases, num_iters
          )
  
imports: import random
  import warnings
  import numpy
  from scipy.spatial.transform import Rotation
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops.transforms
  import nvidia.dali.ops
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  from sequences_test_utils import ArgData, ArgDesc, sequence_suite_helper, ArgCb, ParamsProvider
  from nose_utils import assert_raises
label_desc: Use image node_id 27 for calling a global function with example usage: test_sequences() and returns: range, np, np, np, np, np, unknown, unfolded, str