You could seriously abuse side effects in a comprehension :-) :
Input = 2
Array = [2,1,3,2,2,2,1,2,2]
r = []
Result = max([(r.append(1),len(r))[1] if x==Input else (r.clear(),0)[1] for x in Array])
.
That kind of rigamarole wouldn't be necessary if Python allowed assignments in expressions:
r = 0
Result = max([++r if x==Input else r=0 for x in Array]) # What we want, but NOT valid Python!
Note that a generator expression could be used instead of the list comprehension if you don't want to look at the intermediate result. For the toy Array it doesn't matter, but for an Array of hundreds of thousands of elements the generator saves memory.