<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_values(self, data, filter_values):
 """ Turn the raw bucket data into a list of tuples containing the key, number of documents and a flag indicating whether this value has been selected or not. """

        out = []
        for bucket in data.buckets:
            key = self.get_value(bucket)
            out.append((
                key,
                self.get_metric(bucket),
                self.is_filtered(key, filter_values)
            ))
        return out