def METHOD_NAME(data_iterator, is_input_float, inp_dtype, out_dtype):
    imgs = fn.external_source(source=data_iterator)
    o_dtype = dali_type_to_np(out_dtype)
    # converting float inputs to integer outs leads to binary images as
    # input is in -1 to 1 range in such case
    if is_input_float and not np.issubdtype(o_dtype, np.floating):
        imgs *= 255
    H = fn.random.uniform(range=[-20, 20])
    S = fn.random.uniform(range=[0, 2])
    brightness = fn.random.uniform(range=[0, 2])
    contrast = fn.random.uniform(range=[0, 2])
    out_dtype_arg = out_dtype if out_dtype != inp_dtype else None
    out_cpu, out_gpu = (
        fn.color_twist(input, hue=H, saturation=S, brightness=brightness, contrast=contrast,
                       dtype=out_dtype_arg) for input in (imgs, imgs.gpu()))
    return imgs, out_cpu, out_gpu, H, S, brightness, contrast