code: def test_avro_reader_multiblock(
      dtype,
      codec,
      use_sync_interval,
      total_rows_and_num_rows_and_skip_rows_and_rows_per_block,
  ):
      (
          total_rows,
          num_rows,
          skip_rows,
          rows_per_block,
      ) = total_rows_and_num_rows_and_skip_rows_and_rows_per_block
  
      assert total_rows >= num_rows
      assert rows_per_block <= total_rows
  
      limit_rows = num_rows != total_rows
      if limit_rows:
          assert total_rows >= num_rows + skip_rows
  
      if dtype == "str":
          avro_type = "string"
  
          # Generate a list of strings, each of which is a 6-digit number, padded
          # with leading zeros.  This data set was very useful during development
          # of the multiblock avro reader logic, as you get implicit feedback as
          # to what may have gone wrong when the test fails, based on the
          # expected vs actual values.
          values = [f"{i:0>6}" for i in range(0, total_rows)]
  
          # Strings are encoded in avro with a zigzag-encoded length prefix, and
          # then the string data.  As all of our strings are fixed at length 6,
          # we only need one byte to encode the length prefix (0xc).  Thus, our
          # bytes per row is 6 + 1 = 7.
          bytes_per_row = len(values[0]) + 1
          assert bytes_per_row == 7, bytes_per_row
      else:
          assert dtype in ("float32", "float64")
          avro_type = "float" if dtype == "float32" else "double"
  
          # We don't use rand_dataframe() here, because it increases the
          # execution time of each test by a factor of 10 or more (it appears
          # to use a very costly approach to generating random data).
          # See also: https://github.com/rapidsai/cudf/issues/13128
          values = np.random.rand(total_rows).astype(dtype)
          bytes_per_row = values.dtype.itemsize
  
      # The sync_interval is the number of bytes between sync blocks.  We know
      # how many bytes we need per row, so we can calculate the number of bytes
      # per block by multiplying the number of rows per block by the bytes per
      # row.  This is the sync interval.
      total_bytes_per_block = rows_per_block * bytes_per_row
      sync_interval = total_bytes_per_block
  
      source_df = cudf.DataFrame({"0": pd.Series(values)})
  
      if limit_rows:
          expected_df = source_df[
              skip_rows : skip_rows + num_rows
          ].reset_index(drop=True)
      else:
          expected_df = source_df[skip_rows:].reset_index(drop=True)
  
      records = source_df.to_pandas().to_dict(orient="records")
  
      schema = {
          "name": "root",
          "type": "record",
          "fields": [
              {"name": "0", "type": avro_type},
          ],
      }
  
      if use_sync_interval:
          kwds = {"sync_interval": sync_interval}
      else:
          kwds = {}
  
      kwds["codec"] = codec
  
      buffer = io.BytesIO()
      fastavro.writer(buffer, schema, records, **kwds)
      buffer.seek(0)
  
      if not limit_rows:
          # Explicitly set num_rows to None if we want to read all rows.  This
          # ensures we exercise the logic behind a read_avro() call where the
          # caller doesn't specify the number of rows desired (which will be the
          # most common use case).
          num_rows = None
      actual_df = cudf.read_avro(
          buffer, skiprows=skip_rows, num_rows=num_rows
      )
  
      assert_eq(expected_df, actual_df)
  
imports: import datetime
  import io
  import pathlib
  from typing import Optional
  import fastavro
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing._utils import assert_eq
  from cudf.testing.dataset_generator import rand_dataframe
label_desc: Use image node_id 16 for calling a global function with example usage: test_avro_reader_multiblock(dtype, codec, use_sync_interval, total_rows_and_num_rows_and_skip_rows_and_rows_per_block) without return types