Since you are using Python 3, you can change your code to the following code and it should fix the error. In Python 2, use of tuple was allowed, but tuple will not work in Python3.
return max(map(lambda a: (0 if a[0] == 0 else float(a[1]) / (a[0] + k)), counts))