code: def write_samples(
      results: cudf.DataFrame,
      offsets: cudf.DataFrame,
      renumber_map: cudf.DataFrame,
      batches_per_partition: cudf.DataFrame,
      output_path: str,
  ):
      """
      Writes the samples to parquet.
  
      Batches in each partition that are empty are discarded, and the remaining non-empty
      batches are renumbered to be contiguous starting from the first
      batch id in the partition.
      This means that the output batch ids may not match the input batch ids.
  
      results: cudf.DataFrame
          The results dataframe containing the sampled minibatches.
      offsets: cudf.DataFrame
          The offsets dataframe indicating the start/end of each minibatch
          in the reuslts dataframe.
      renumber_map: cudf.DataFrame
          The renumber map containing the mapping of renumbered vertex ids
          to original vertex ids.
      batches_per_partition: int
          The maximum number of minibatches allowed per written parquet partition.
      output_path: str
          The output path (where parquet files should be written to).
      """
  
      if ("majors" in results.columns) and (
          "minors" in results.columns
      ):
          write_fn = _write_samples_to_parquet_coo
  
      # TODO these names will be deprecated in release 23.12
      elif ("sources" in results.columns) and (
          "destinations" in results.columns
      ):
          write_fn = _write_samples_to_parquet_coo
  
      elif (
          "major_offsets" in results.columns
          and "minors" in results.columns
      ):
          write_fn = _write_samples_to_parquet_csr
  
      else:
          raise ValueError("invalid columns")
  
      if hasattr(results, "compute"):
          results.map_partitions(
              write_fn,
              offsets,
              renumber_map,
              batches_per_partition,
              output_path,
              align_dataframes=False,
              meta=cudf.Series(dtype="int64"),
          ).compute()
  
      else:
          write_fn(
              results,
              offsets,
              renumber_map,
              batches_per_partition,
              output_path,
              partition_info="sg",
          )
  
file_path: cugraph/python/cugraph/cugraph/gnn/data_loading/bulk_sampler_io.py
imports: import os
  import cudf
  import cupy
  from math import ceil
  from pandas import isna
  from typing import Union, Optional, List
label_desc: Use image node_id 4 for calling a global function with example usage: write_samples(results, offsets, renumber_map, batches_per_partition, output_path) without return types