class_docstr: A GenomicsWriter that dispatches based on the file extension.
  
  If '.tfrecord' is present in the filename, a TFRecordWriter is used.
  Otherwise, a native writer is.
  
  Sub-classes of DispatchingGenomicsWriter must define a _native_writer()
  method.
class_docstr_tok: ["A","GenomicsWriter","that","dispatches","based","on","the","file","extension",".","If","'.tfrecord","'","is","present","in","the","filename",",","a","TFRecordWriter","is","used",".","Otherwise",",","a","native","writer","is",".","Sub-classes","of","DispatchingGenomicsWriter","must","define","a","_native_writer","(",")","method","."]
docstr: Initializer.
  
  Args:
    output_path: str. The output path to which the records are written.
    **kwargs: k=v named args. Keyword arguments used to instantiate the native
      writer, if applicable.
docstr_tok: ["Initializer",".","Args",":","output_path",":","str",".","The","output","path","to","which","the","records","are","written",".","*","*","kwargs",":","k=v","named","args",".","Keyword","arguments","used","to","instantiate","the","native","writer",",","if","applicable","."]
code: def __init__(self, output_path, **kwargs):
      """Initializer.
  
      Args:
        output_path: str. The output path to which the records are written.
        **kwargs: k=v named args. Keyword arguments used to instantiate the native
          writer, if applicable.
      """
      super(DispatchingGenomicsWriter, self).__init__()
      self.header = kwargs.get("header", None)
  
      if ".tfrecord" in output_path:
          self._writer = TFRecordWriter(output_path, header=self.header)
      else:
          self._writer = self._native_writer(output_path, **kwargs)
      logging.info(
          "Writing %s with %s",
          output_path,
          self._writer.__class__.__name__,
      )
      self._post_init_hook()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import errno
  from absl import logging
  from third_party.nucleus.io.python import tfrecord_writer
label_desc: Use image node_id 1 to create a new DispatchingGenomicsWriter object from inherited base classes: GenomicsWriter with example: obj = DispatchingGenomicsWriter(output_path)