local_weighted_learning.py: fix mypy errors and more
#8073
+113
−76
Merged