Does this line in Python indicate that KNN is weighted?
Yes, the line indicates that KNN is weighted and that the weight is the inverse of the distance. All of this can easily be found in scikit-learn's documentation

Also, pro-tip, you can find an object's documentation using the help function. In this case:

from sklearn.neighbors import KNeighborsClassifier

print(help(KNeighborsClassifier))


As to how weighted KNN works, I actually made a learning unit on my website about this.

In short, weighting the instances means that instead of each neighbor having an equal vote, their vote is weighted. This means that if for instance, in my 3 nearest-neighbors, 2 of them are of class A but have low weights, and 1 of them is of class B and has a high weight, KNN might still pick class B even though more neighbors are of class A.