(tokens: List[Any], start: int,
                              span_len: int)
return (j - start) // span_len, j
Get longest repeat start at some id with certain repeat size.

  For example, _longest_repeat_with_size([2,2, 3, 3, 4, 1, 5, 5], 0, 2) returns
  (0, 4)
  Args:
    tokens: list of tokens.
    start: search start index.
    span_len: length of repeating tokens.

  Returns:
    Span of longest repeating subsequence starting at start, with repeat size of
    span_len.
Get longest repeat start at some id with certain repeat size.
Get longest repeat start at some id with certain repeat size .
def _longest_repeat_with_size(tokens: List[Any], start: int,
                              span_len: int) -> Tuple[int, int]:
  """Get longest repeat start at some id with certain repeat size.

  For example, _longest_repeat_with_size([2,2, 3, 3, 4, 1, 5, 5], 0, 2) returns
  (0, 4)
  Args:
    tokens: list of tokens.
    start: search start index.
    span_len: length of repeating tokens.

  Returns:
    Span of longest repeating subsequence starting at start, with repeat size of
    span_len.
  """
  j = start + span_len
  while j < len(tokens):
    if tokens[j] != tokens[start + (j - start) % span_len]:
      break
    j += 1
  return (j - start) // span_len, j
def _longest_repeat_with_size ( tokens : List [ Any ] , start : int , span_len : int ) -> Tuple [ int , int ] : j = start + span_len while j < len ( tokens ) : if tokens [ j ] != tokens [ start + ( j - start ) % span_len ] : break j += 1 return ( j - start ) // span_len , j