def __getitem__(self, key):
        dist = sum(self._penalties[key]) * self._weights[key]
        dist_max = self.max_distance
        if dist_max:
            return dist / dist_max
        return 0.0
Returns the weighted distance for a named penalty.
dataset/ETHPy150Open beetbox/beets/beets/autotag/hooks.py/Distance.__getitem__