code: def doc_field_length(self, docnum, fieldname):
      if fieldname in self.lens:
          if docnum < len(self.lens[fieldname]):
              return self.lens[fieldname][docnum]
      return 1
  
imports: from __future__ import with_statement
  import random
  from array import array
  import pytest
  from whoosh import analysis, fields, formats, query
  from whoosh.compat import u, b, text_type
  from whoosh.compat import array_tobytes, xrange
  from whoosh.codec import default_codec
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 2 for calling the FakeLengths obj's underlying member method code with example usage: obj.doc_field_length(docnum, fieldname) and returns: int, self