code: def test_avro_dataset_partition():
      """test_avro_dataset_partition"""
      # The test.bin was created from avro/lang/c++/examples/datafile.cc.
      filename = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_avro",
          "test.bin",
      )
      filename = "file://" + filename
  
      schema_filename = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_avro",
          "cpx.json",
      )
      with open(schema_filename) as f:
          schema = f.read()
      for _ in [1, 2, 3, 11, 12, 13, 50, 51, 100]:  # capacity
          re_dataset = tfio.IODataset.from_avro(
              filename, schema, ["re"]
          )
          i = 0
          for v in re_dataset:
              re = v
              assert re.numpy() == 100.0 * i
              i += 1
          assert i == 100
  
          im_dataset = tfio.IODataset.from_avro(
              filename, schema, ["im"]
          )
          i = 0
          for v in im_dataset:
              im = v
              assert im.numpy() == 100.0 + i
              i += 1
          assert i == 100
  
imports: import os
  import numpy
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 3 for calling a global function with example usage: test_avro_dataset_partition() without return types