code: def writeGlobalFileStream(self, cleanup=False):
          
          
          # TODO: Make this work with FileID
          with self.jobStore.writeFileStream(None if not cleanup else self.jobGraph.jobStoreID) as (backingStream, fileStoreID):
              # We have a string version of the file ID, and the backing stream.
              # We need to yield a stream the caller can write to, and a FileID
              # that accurately reflects the size of the data written to the
              # stream. We assume the stream is not seekable.
              
              # Make and keep a reference to the file ID, which is currently empty
              fileID = FileID(fileStoreID, 0)
              
              # Wrap the stream to increment the file ID's size for each byte written
              wrappedStream = WriteWatchingStream(backingStream)
              
              # When the stream is written to, count the bytes
              def handle(numBytes):
                  fileID.size += numBytes 
              wrappedStream.onWrite(handle)
              
              yield wrappedStream, fileID
docs: Similar to writeGlobalFile, but allows the writing of a stream to the job store.
          The yielded file handle does not need to and should not be closed explicitly.
  
          :param bool cleanup: is as in :func:`toil.fileStore.FileStore.writeGlobalFile`.
          :return: A context manager yielding a tuple of
                    1) a file handle which can be written to and
                    2) the toil.fileStore.FileID of the resulting file in the job store.