def _LongestRun(seq, value):
 off = (-1)
 max_run = 0
 i = 0
 while (i < len(seq)):
  run = 0
  while (((i + run) < len(seq)) and (seq[(i + run)] == value)):
   run += 1
  if (run > max_run):
   off = i
   max_run = run
  i += (1 + run)
 return (off, max_run)

def _LongestRun ( seq , value ) : off = ( - 1 ) max_run = 0 i = 0 while ( i < len ( seq ) ) : run = 0 while ( ( ( i + run ) < len ( seq ) ) and ( seq [ ( i + run ) ] == value ) ) : run += 1 if ( run > max_run ) : off = i max_run = run i += ( 1 + run ) return ( off , max_run )
finds the longest run of value in seq .