def _open(self):
        f = self.file
        # TODO: DRY this up with ReadWriteFileResource.
        try:
            seek = f.seek
        except __HOLE__:
            f = tempfile.SpooledTemporaryFile(mode='w+t', encoding=self.encoding)
            self.file = f
            seek = f.seek
        seek(0)


# TODO: add more to the repr and test.
# TODO: give a better name and test edge cases.
dataset/ETHPy150Open cjerdonek/open-rcv/openrcv/streams.py/TempFileResource._open