generalize data example code