code: def test_create_metadata_file(tmpdir, partition_on):
      tmpdir = str(tmpdir)
  
      # Write ddf without a _metadata file
      df1 = cudf.DataFrame(
          {"b": range(100), "a": ["A", "B", "C", "D"] * 25}
      )
      df1.index.name = "myindex"
      ddf1 = dask_cudf.from_cudf(df1, npartitions=10)
      ddf1.to_parquet(
          tmpdir,
          write_metadata_file=False,
          partition_on=partition_on,
      )
  
      # Add global _metadata file
      if partition_on:
          fns = glob.glob(
              os.path.join(tmpdir, partition_on + "=*/*.parquet")
          )
      else:
          fns = glob.glob(os.path.join(tmpdir, "*.parquet"))
      dask_cudf.io.parquet.create_metadata_file(
          fns,
          split_every=3,  # Force tree reduction
      )
  
      # Check that we can now read the ddf
      # with the _metadata file present
      ddf2 = dask_cudf.read_parquet(
          tmpdir,
          split_row_groups=False,
          index="myindex",
          calculate_divisions=True,
      )
      if partition_on:
          ddf1 = df1.sort_values("b")
          ddf2 = ddf2.compute().sort_values("b")
          ddf2.a = ddf2.a.astype("object")
      dd.assert_eq(ddf1, ddf2)
  
imports: import glob
  import math
  import os
  import numpy
  import pandas
  import pytest
  import dask
  from dask import dataframe
  from dask.utils import natural_sort_key
  import cudf
  import dask_cudf
label_desc: Use image node_id 18 for calling a global function with example usage: test_create_metadata_file(tmpdir, partition_on) without return types