class_docstr: A stream backed corpus view for corpus files that consist of
  sequences of serialized Python objects (serialized using
  ``pickle.dump``).  One use case for this class is to store the
  result of running feature detection on a corpus to disk.  This can
  be useful when performing feature detection is expensive (so we
  don't want to repeat it); but the corpus is too large to store in
  memory.  The following example illustrates this technique:
  
      >>> from nltk.corpus.reader.util import PickleCorpusView
      >>> from nltk.util import LazyMap
      >>> feature_corpus = LazyMap(detect_features, corpus) # doctest: +SKIP
      >>> PickleCorpusView.write(feature_corpus, some_fileid)  # doctest: +SKIP
      >>> pcv = PickleCorpusView(some_fileid) # doctest: +SKIP
class_docstr_tok: ["A","stream","backed","corpus","view","for","corpus","files","that","consist","of","sequences","of","serialized","Python","objects","(","serialized","using","``","pickle.dump","``",")",".","One","use","case","for","this","class","is","to","store","the","result","of","running","feature","detection","on","a","corpus","to","disk",".","This","can","be","useful","when","performing","feature","detection","is","expensive","(","so","we","do","n't","want","to","repeat","it",")",";","but","the","corpus","is","too","large","to","store","in","memory",".","The","following","example","illustrates","this","technique",":",">",">",">","from","nltk.corpus.reader.util","import","PickleCorpusView",">",">",">","from","nltk.util","import","LazyMap",">",">",">","feature_corpus","=","LazyMap","(","detect_features",",","corpus",")","#","doctest",":","+SKIP",">",">",">","PickleCorpusView.write","(","feature_corpus",",","some_fileid",")","#","doctest",":","+SKIP",">",">",">","pcv","=","PickleCorpusView","(","some_fileid",")","#","doctest",":","+SKIP"]
code: def read_block(self, stream):
      result = []
      for i in range(self.BLOCK_SIZE):
          try:
              result.append(pickle.load(stream))
          except EOFError:
              break
      return result
  
imports: import bisect
  import os
  import pickle
  import re
  import tempfile
  from functools import reduce
  from xml.etree import ElementTree
  from nltk.data import FileSystemPathPointer, PathPointer, SeekableUnicodeStreamReader, ZipFilePathPointer
  from nltk.internals import slice_bounds
  from nltk.tokenize import wordpunct_tokenize
  from nltk.util import AbstractLazySequence, LazyConcatenation, LazySubsequence
label_desc: Use image node_id 2 for calling the PickleCorpusView obj's underlying member method code with example usage: obj.read_block(stream) and returns: result