code: def write_length_and_key(fp, value):
      
      written = write_fmt(fp, 'I', 0 if value in _TERMS else len(value))
      written += write_bytes(fp, value)
      return written
docs: Helper to write descriptor key.