docstr: Tests writing all the records that are 'canned' in our tfrecord file.
docstr_tok: ["Tests","writing","all","the","records","that","are","'canned","'","in","our","tfrecord","file","."]
code: def test_writing_canned_records(self):
      """Tests writing all the records that are 'canned' in our tfrecord file."""
      # This file is in TFRecord format.
      tfrecord_file = test_utils.genomics_core_testdata(
          "test_regions.bed.tfrecord"
      )
  
      header = bed_pb2.BedHeader(num_fields=12)
      writer_options = bed_pb2.BedWriterOptions()
      bed_records = list(
          tfrecord.read_tfrecords(
              tfrecord_file, proto=bed_pb2.BedRecord
          )
      )
      out_fname = test_utils.test_tmpfile("output.bed")
      with bed_writer.BedWriter.to_file(
          out_fname, header, writer_options
      ) as writer:
          for record in bed_records:
              writer.write(record)
  
      with epath.Path(out_fname).open("r") as f:
          self.assertEqual(f.readlines(), self.expected_bed_content)
  
file_path: deepvariant/third_party/nucleus/io/python/bed_writer_wrap_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  from etils import epath
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.io.python import bed_writer
  from third_party.nucleus.protos import bed_pb2
  from third_party.nucleus.testing import test_utils
label_desc: Use image node_id 2 for calling the WrapBedWriterTest obj's underlying member method code with example usage: obj.test_writing_canned_records() without return types