code: def _save_partition_files(
      bc,
      table_name,
      data_partition_array_dict,
      output,
      file_format,
      num_files,
  ):
      values_partitions = _get_partition_values(
          data_partition_array_dict
      )
      columns = _get_columns_names(bc, table_name)
      view_columns = _select_columns(columns, values_partitions)
  
      combination_partition = _combine_partitions(
          data_partition_array_dict
      )
  
      if num_files == 1:
          for partition in combination_partition:
              where_clause = " and ".join(partition)
  
              query = "select count(*) from {} where {}".format(
                  table_name, where_clause
              )
              result = bc.sql(query)
  
              if type(result) is dask_cudf.core.DataFrame:
                  result = result.compute()
  
              total_registers = result.values.tolist()[0][0]
  
              if total_registers == 0:
                  continue
  
              query = "select {} from {} where {}".format(
                  view_columns, table_name, where_clause
              )
              _save(
                  bc.sql(query),
                  output,
                  partition,
                  table_name,
                  file_format,
                  table_name,
              )
  
      elif num_files >= 1:
          for partition in combination_partition:
              where_clause = " and ".join(partition)
  
              query = "select count(*) from {} where {}".format(
                  table_name, where_clause
              )
              result = bc.sql(query)
  
              if type(result) is dask_cudf.core.DataFrame:
                  result = result.compute()
  
              total_registers = result.values.tolist()[0][0]
  
              if total_registers == 0:
                  continue
  
              registers_per_parquet = math.ceil(
                  total_registers / num_files
              )
  
              index = 0
              df = bc.sql(
                  "select {} from {} where {}".format(
                      view_columns, table_name, where_clause
                  )
              )
  
              if type(df) is dask_cudf.core.DataFrame:
                  df = df.compute()
  
              for i in range(0, total_registers, registers_per_parquet):
                  pf = df.iloc[i : i + registers_per_parquet]
  
                  _save(
                      pf,
                      output,
                      partition,
                      table_name + "_" + str(index),
                      file_format,
                      table_name,
                  )
                  index += 1
  
      else:
          print("num_files must be greater than 1.")
  
imports: from blazingsql import BlazingContext
  import os
  import math
  import filecmp
  import shutil
  from itertools import combinations
  import pandas
  import dask_cudf
label_desc: Use image node_id 10 for calling a global function with example usage: _save_partition_files(bc, table_name, data_partition_array_dict, output, file_format, num_files) without return types