importdmlibasdmimportnumpyasnpdefgroup_func(x):returnx%8deftask_func(x):returnx%3+1deftest_dm_map_reduce():mr=dm.MapReduce()# generate test inputinput_dim=(1024,16)x=np.random.rand(input_dim[0],input_dim[1])num_group_keys=8mr.map(x,group_func,num_group_keys)y=mr.reduce(task_func)print(y)if__name__==‘__main__‘:test_dm_map_reduce()