code: def get_permutations(bucket_counts: List[int]) -> Tuple[List[mx.nd.NDArray], List[mx.nd.NDArray]]:
      
      data_permutations = []  # type: List[mx.nd.NDArray]
      inverse_data_permutations = []  # type: List[mx.nd.NDArray]
      for num_samples in bucket_counts:
          if num_samples == 0:
              num_samples = 1
          # new random order:
          data_permutation = np.random.permutation(num_samples)
          inverse_data_permutation = np.empty(num_samples, np.int32)
          inverse_data_permutation[data_permutation] = np.arange(num_samples)
          inverse_data_permutation = mx.nd.array(inverse_data_permutation)
          data_permutation = mx.nd.array(data_permutation)
  
          data_permutations.append(data_permutation)
          inverse_data_permutations.append(inverse_data_permutation)
      return data_permutations, inverse_data_permutations
docs: Returns the indices of a random permutation for each bucket and the corresponding inverse permutations that can
      restore the original order of the data if applied to the permuted data.
  
      :param bucket_counts: The number of elements per bucket.
      :return: For each bucket a permutation and inverse permutation is returned.