def METHOD_NAME(self, results, range_lookup):
    if "buckets" in results:
        bucket = results["buckets"][0]
        for key, value in bucket.items():
            if key in range_lookup:
                bucket[key]["buckets"][0]["from"] = range_lookup[key][0]
                bucket[key]["buckets"][0]["to"] = range_lookup[key][1]
                self.METHOD_NAME(value, range_lookup)
    return results