class ShiftDetector: def detect(self, e): return [{'from': e[i-1], 'to': e[i]} for i in range(1, len(e)) if e[i] != e[i-1]]