def dist(a, b):
    return sum((i-j)**2 for i, j in zip(a, b))
def _assert_type(self, value, t, id, expected):
        if not isinstance(value, t):
            raise TransactionError(_('Unexpected type of "{id}", {exp} expected.').format(id=id, exp=expected))