def get_residue_ranges(numbers):
    """Given a list of integers, creates a list of ranges with the consecutive numbers found in the list.

    Parameters
    ----------
    numbers: list
       A list of integers

    Returns
    ------
    list
        A list with the ranges of consecutive numbers found in the list
    """
    nums = sorted(set(numbers))
    gaps = [[s, e] for s, e in zip(nums, nums[1:]) if s + 3 < e]
    edges = iter(nums[:1] + sum(gaps, []) + nums[-1:])
    return list(zip(edges, edges))