def prepare_data(in_data, correction):
    """Prepare data to be feed into (image, steering angle) generator.
    
    Input data maps 3 images per record - center camera, left camera and right camera.
    Output data has 1 image per record. The correction is applied for left and right camera images.
    
    Args:
        in_data: data from csv file (dictionary)
        correction: positive float to be applied to right and left image's steering angles
    """
    assert (correction >= 0.0)

    in_records = len(in_data['STEERING_ANGLE'])
    out_data = {'IMAGE': [], 'STEERING_ANGLE': []}

    for i in range(in_records):
        out_data['IMAGE'].append(in_data['CENTER_IMAGE'][i])
        out_data['STEERING_ANGLE'].append(in_data['STEERING_ANGLE'][i])

        out_data['IMAGE'].append(in_data['LEFT_IMAGE'][i])
        left_angle = in_data['STEERING_ANGLE'][i] + correction
        left_angle = left_angle if left_angle <= 1.0 else 1.0
        out_data['STEERING_ANGLE'].append(left_angle)

        out_data['IMAGE'].append(in_data['RIGHT_IMAGE'][i])
        right_angle = in_data['STEERING_ANGLE'][i] - correction
        right_angle = right_angle if right_angle >= -1.0 else -1.0
        out_data['STEERING_ANGLE'].append(right_angle)

    assert (len(out_data['IMAGE']) == len(out_data['STEERING_ANGLE']))

    return out_data