class_docstr: Tests for BedWriter.
class_docstr_tok: ["Tests","for","BedWriter","."]
code: def test_roundtrip_num_fields(self, num_fields):
      all_num_fields_in_file = [
          n for n in _VALID_NUM_BED_FIELDS if n >= num_fields
      ]
      for num_fields_in_file in all_num_fields_in_file:
          lines = [
              "\t".join(line[:num_fields_in_file])
              for line in self.tokens
          ]
          contents = "{}\n".format("\n".join(lines))
          input_path = test_utils.test_tmpfile(
              "test_field.bed", contents=contents
          )
  
          with bed.BedReader(
              input_path, num_fields=num_fields
          ) as reader:
              records = list(reader.iterate())
          output_path = test_utils.test_tmpfile("test_field2.bed")
          with bed.BedWriter(
              output_path, header=reader.header
          ) as writer:
              for record in records:
                  writer.write(record)
  
          with bed.BedReader(output_path) as reader2:
              v2_records = list(reader2.iterate())
  
          self.assertLen(records, 3)
          self.assertEqual(records, v2_records)
  
file_path: deepvariant/third_party/nucleus/io/bed_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 third_party.nucleus.io import bed
  from third_party.nucleus.io.python import bed_reader
  from third_party.nucleus.protos import bed_pb2
  from third_party.nucleus.testing import test_utils
label_desc: Use image node_id 3 for calling the BedWriterTests obj's underlying member method code with example usage: obj.test_roundtrip_num_fields(num_fields) without return types