code: def length_to_byte(length):
      if length is None:
          return 0
      if length >= 106374:
          return 255
      else:
          return bisect_left(_length_byte_cache, length)
  
imports: import math, struct
  from array import array
  from bisect import bisect_left
  from struct import pack, unpack
  from whoosh.compat import b, long_type
  from whoosh.system import pack_byte, unpack_byte, pack_ushort, unpack_ushort
  from whoosh.system import pack_int, unpack_int, pack_uint, unpack_uint
  from whoosh.system import pack_long, unpack_long, pack_ulong, unpack_ulong
  from whoosh.system import pack_float, unpack_float, pack_double, unpack_double
label_desc: Use image node_id 13 for calling a global function with example usage: length_to_byte(length) and returns: int, int, bisect_left