<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_nth_unique_value(self, keypath, n, distance_from, open_interval=True):
 """ Returns the `n-1`th unique value, or raises a contradiction if that is out of bounds """

        unique_values = self.get_ordered_values(keypath, distance_from, open_interval)
        if 0 <= n < len(unique_values):
            #logging.error("%i th unique value is %s" % (n, str(unique_values[n])))
            return unique_values[n]
        else:
            raise Contradiction("n-th Unique value out of range: " + str(n))