sampleSplitting generalized script