def read(self):
        # TODO: check the lengths?
        try:
            key_length = self.read_int()
        except struct.error:
            return None

        try:
            key = self._read()
            assert self.file.read(1) == b'\t'
            val_length = self.read_int()
            val = self._read()
            assert self.file.read(1) == b'\n'
        except (__HOLE__, struct.error):
            raise struct.error("EOF before complete pair read")

        return key, val
dataset/ETHPy150Open dougalsutherland/py-sdm/sdm/typedbytes_utils.py/TypedbytesSequenceFileStreamingInput.read