code: def __init__(
      self,
      filename=None,
      start_offset=0,
      compression_type=None,
      status=None,
  ):
      if filename is None:
          raise errors.NotFoundError(
              None, None, "No filename provided, cannot read Events"
          )
      if not gfile.exists(filename):
          raise errors.NotFoundError(
              None,
              None,
              "{} does not point to valid Events file".format(filename),
          )
      if start_offset:
          raise errors.UnimplementedError(
              None, None, "start offset not supported by compat reader"
          )
      if compression_type:
          # TODO: Handle gzip and zlib compressed files
          raise errors.UnimplementedError(
              None, None, "compression not supported by compat reader"
          )
      self.filename = filename
      self.start_offset = start_offset
      self.compression_type = compression_type
      self.status = status
      self.curr_event = None
      self.file_handle = gfile.GFile(self.filename, "rb")
      # Maintain a buffer of partially read records, so we can recover from
      # truncated records upon a retry.
      self._buffer = b""
      self._buffer_pos = 0
  
file_path: tensorboard/tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py
imports: import array
  import struct
  from .None import errors
  from .io import gfile
label_desc: Use image node_id 1 to create a new PyRecordReader_New object  with example: obj = PyRecordReader_New(filename, start_offset, compression_type, status)