def METHOD_NAME(variants_vec_spectral, origin, direction):
    # Check the correctness of the sample_ray() method
    camera = create_camera(origin, direction)
    near_clip = 1.0
    time = 0.5
    wav_sample = [0.5, 0.33, 0.1]
    pos_sample = [[0.2, 0.1, 0.2], [0.6, 0.9, 0.2]]
    aperture_sample = 0 # Not being used
    ray, spec_weight = camera.sample_ray(time, wav_sample, pos_sample, aperture_sample)
    # Importance sample wavelength and weight
    wav, spec = mi.sample_rgb_spectrum(mi.sample_shifted(wav_sample))
    assert dr.allclose(ray.wavelengths, wav)
    assert dr.allclose(spec_weight, spec)
    assert dr.allclose(ray.time, time)
    # Check that ray origins are on the plane defined by the sensor
    assert dr.allclose(dr.dot(ray.o, direction), dr.dot(origin + mi.Vector3f(direction) * near_clip, direction))
    # Check that a [0.5, 0.5] position_sample generates a ray
    # that points in the camera direction
    ray, _ = camera.sample_ray(0, 0, [0.5, 0.5], 0)
    assert dr.allclose(ray.d, direction, atol=1e-7)