import re


def extract_alternative_numbers(text):
    """
    Returns a list of numbers given a string of text.  For example,
    extract_alternative_numbers("1, 2, and 3") returns [1,2,3].
    extract_alternative_numbers["1-2 or 3-5"] returns [1, 2, 3, 4, 5].

    Parameters:
        text (String): text that recite alternate numbers in string
    """
    claim_num = []

    # Add to claim_num all claim all claims in range
    # for case when ranges are written as '1-2'
    # findall_range ex: ['1-2', '3 - 4']
    findall_range = re.findall(r"\d+(?:-| - )\d+", text)
    if bool(findall_range):
        for range_ in findall_range:
            i = range_.split("-")
            claim_num.extend(range(int(i[0].strip()), int(i[1].strip()) + 1))
        text = re.sub(r"\d+(?:-| - )\d+", "", text)

    # for case when ranges are written as '1 to 2'
    # findall_range ex: ['1 to 2', '3 to 4']
    findall_range = re.findall(r"\d+ to \d+", text)
    if bool(findall_range):
        for range_ in findall_range:
            i = range_.split("to")
            claim_num.extend(range(int(i[0]), int(i[1]) + 1))
        text = re.sub(r"\d+ to \d+", "", text)

    # for all other cases of numbers in text; ex. '1, 2'
    findall_range = re.findall(r"\d+", text)
    # convert string to int
    findall_range = [int(i) for i in findall_range]
    claim_num.extend(findall_range)

    return claim_num