code: def test_external_source_mixed_contiguous():
      batch_size = 2
      iterations = 4
  
      def generator(i):
          if i % 2:
              return cp.array(
                  [[100 + i * 10 + 1.5]] * batch_size, dtype=cp.float32
              )
          else:
              return batch_size * [
                  cp.array([100 + i * 10 + 1.5], dtype=cp.float32)
              ]
  
      pipe = Pipeline(batch_size, 3, 0)
  
      pipe.set_outputs(
          fn.external_source(
              device="gpu", source=generator, no_copy=True
          )
      )
      pipe.build()
  
      pattern = (
          "ExternalSource operator should not mix contiguous and noncontiguous inputs. "
          "In such a case the internal memory used to gather data in a contiguous chunk of "
          "memory would be trashed."
      )
      with check_output_pattern(pattern):
          for _ in range(iterations):
              pipe.run()
  
file_path: DALI/dali/test/python/test_external_source_cupy.py
imports: from nose.plugins.attrib import attr
  from test_external_source_impl import *
  from test_external_source_impl import use_cupy
  from test_utils import check_output, check_output_pattern
  import nvidia.dali
  from nvidia.dali import Pipeline, pipeline_def
  import nvidia.dali.fn
  from nvidia.dali.tensors import TensorGPU
  import numpy
  import cupy
label_desc: Use image node_id 2 for calling a global function with example usage: test_external_source_mixed_contiguous() and returns: cp, unknown