code: def binsearch(reader, key, compare_func=cmp, block_size=8192):
      
  
      min_ = binsearch_offset(reader, key, compare_func, block_size)
  
      reader.seek(min_)
  
      if min_ > 0:
          reader.readline()  # skip partial line
  
      def gen_iter(line):
          while line:
              yield line.rstrip()
              line = reader.readline()
  
      return gen_iter(reader.readline())
docs: Perform a binary search for a specified key to within a 'block_size'
      (default 8192) granularity, and return first full line found.