code: def generate_file(
      file_index: int,
      global_row_index: int,
      num_rows_in_file: int,
      num_row_groups_per_file: int,
      compression: str,
      data_dir: str,
  ):
      buffs = []
      for group_index, group_global_row_index in enumerate(
          range(
              0,
              num_rows_in_file,
              num_rows_in_file // num_row_groups_per_file,
          )
      ):
          num_rows_in_group = min(
              num_rows_in_file // num_row_groups_per_file,
              num_rows_in_file - group_global_row_index,
          )
          buffs.append(
              generate_row_group(
                  group_index, group_global_row_index, num_rows_in_group
              )
          )
      df = pd.concat(buffs)
      data_size = df.memory_usage(deep=True).sum()
      file_ext = "gz" if compression == "gzip" else "snappy"
      filename = os.path.join(
          data_dir, f"input_data_{file_index}.parquet.{file_ext}"
      )
      df.to_parquet(
          filename,
          compression=compression,
          row_group_size=num_rows_in_file // num_row_groups_per_file,
      )
      return filename, data_size
  
imports: import os
  import pandas
  import numpy
  import ray
label_desc: Use image node_id 2 for calling a global function with example usage: generate_file(file_index, global_row_index, num_rows_in_file, num_row_groups_per_file, compression, data_dir) and returns: filename,  data_size