code: def getPartitionsFromUserPartitions(user_partitions):
      partitions_out = {}
      num_partition_cols = len(user_partitions)
      partition_columns = list(user_partitions.keys())
      num_partitions_per_column = [
          len(user_partitions[col]) for col in partition_columns
      ]
      per_column_count = [0] * num_partition_cols
      done = False
      partition_key = ""
      partition_values = []
      cur_col_ind = 0
      while not done:
          col = partition_columns[cur_col_ind]
          val = user_partitions[col][per_column_count[cur_col_ind]]
          if partition_key == "":
              partition_key = col + "=" + str(val)
          else:
              partition_key = partition_key + "/" + col + "=" + str(val)
          partition_values.append((col, str(val)))
  
          cur_col_ind = (cur_col_ind + 1) % num_partition_cols
  
          # if we cycled back to the first column, then we are done
          # building one of the partitions
          if cur_col_ind == 0:
              partitions_out[partition_key] = partition_values
              partition_key = ""
              partition_values = []
              # now lets increment the per_column_count
              for reverse_ind in list(range(num_partition_cols))[::-1]:
                  per_column_count[reverse_ind] = (
                      per_column_count[reverse_ind] + 1
                  ) % num_partitions_per_column[reverse_ind]
                  if per_column_count[reverse_ind] != 0:
                      break
              done = all([count == 0 for count in per_column_count])
      return partitions_out
  
file_path: blazingsql/pyblazing/pyblazing/apiv2/hive.py
imports: from itertools import repeat
  import cudf
  from TCLIService.ttypes import TOperationState
label_desc: Use image node_id 4 for calling a global function with example usage: getPartitionsFromUserPartitions(user_partitions) and returns: partitions_out