'Get (timestamp-epoch-style, value)'

def get_sample_with_timestamp(self, metric, tags=None, device_name=None, expire=True):

    if ((tags is not None) and isinstance(tags, ListType)):
        tags.sort()
        tags = tuple(tags)
    key = (tags, device_name)
    if (metric not in self._sample_store):
        raise UnknownValue()
    elif (self.is_counter(metric) and (len(self._sample_store[metric][key]) < 2)):
        raise UnknownValue()
    elif (self.is_counter(metric) and (len(self._sample_store[metric][key]) >= 2)):
        res = self._rate(self._sample_store[metric][key][(-2)], self._sample_store[metric][key][(-1)])
        if expire:
            del self._sample_store[metric][key][:(-1)]
        return res
    elif (self.is_gauge(metric) and (len(self._sample_store[metric][key]) >= 1)):
        return self._sample_store[metric][key][(-1)]
    else:
        raise UnknownValue()
