code: def _reader_writer_classes(in_filename, out_filename):
      """Returns reader, writer classes for filenames, if conversion is possible.
  
      Args:
        in_filename: filename of a genomics data file to use as input.
        out_filename: filename of a genomics data file to use as output, or None,
          if no output should be written.
  
      Raises:
        ConversionError: if in_filename is not convertible to out_filename.
      """
      in_filetype = _lookup_filetype(in_filename)
      out_filetype = (
          _lookup_filetype(out_filename) if out_filename else None
      )
  
      if out_filetype:
          if in_filetype != out_filetype:
              raise ConversionError(
                  "Input and output filetypes specified are incompatible."
              )
          input_has_header = in_filetype.has_header and _is_native_file(
              in_filename
          )
          output_requires_header = (
              out_filetype.has_header and _is_native_file(out_filename)
          )
          if output_requires_header and not input_has_header:
              raise ConversionError(
                  "Input file does not have a header, which is needed to construct "
                  "output file"
              )
          writer_class = out_filetype.writer_class
  
      else:
          writer_class = NullWriter
  
      return in_filetype.reader_class, writer_class
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import re
  import sys
  import time
  from absl import app
  from absl import logging
  from third_party.nucleus.io import bed
  from third_party.nucleus.io import fastq
  from third_party.nucleus.io import gff
  from third_party.nucleus.io import sam
  from third_party.nucleus.io import vcf
label_desc: Use image node_id 4 for calling a global function with example usage: _reader_writer_classes(in_filename, out_filename) and returns: in_filetype,  writer_class