subgroup_object: A subgrouping object as returned by form_homogeneous_subgroups()
subgroup_allocations: A list of possible assignments of the allocation variable as returned by compile_possible_subgroup_allocation()
keep_separate_vars: Vector of column names in sample table; items with identical values in those variables will not be put into the same subgroup if at all possible
report_grouping_as_attribute: Boolean, if TRUE, add an attribute table to the permutation functions' output, to be used in scoring during the design optimization
Returns
Shuffling function that on each call returns an index vector for a valid sample permutation