def get_orders(value):
    """
    Return a list of orders for context tiers.

    Parameters
    ----------
    value : int or string
        The maximum context length or a string in the set "bigram" (for
        context 1, and 2), "trigram" (for context 1, 2, and 3), or
        "fourgram" (for contexts 1, 2, 3, and 4).
    """

    # Dictionary used for mapping string descriptions of window size to
    # actual Python ranges; by mapping to `range()` here in advance
    # (and consuming such range into a list), computations is a bit
    # faster and, in particular, it is clearer. Note that we always start
    # from 1, so no zero-length is included in the lists (the zero distance
    # is the actual alignment site itself).
    order_map = {
        "bigram": list(range(1, 2)),
        "trigram": list(range(1, 3)),
        "fourgram": list(range(1, 4)),
    }

    # get mapping
    if isinstance(value, int):
        orders = list(range(1, value + 1))
    elif isinstance(value, str):
        orders = order_map[value]
    else:
        orders = []

    return orders