def get_players(table, hascards=False, haschips=False):
    """ Returns a list of seats at the table. If the button is set, it is
        ordered from first after button, to Button Last. Can specify if seats
        have cards and/or chips.
    """
    if table.TOKENS['D'] == -1:
        btn = 0
    else:
        btn = table.TOKENS['D']

    length = len(table)
    first = (btn + 1) % length
    seats = list(range(first, length)) + list(range(first))

    seatlist = [table.seats[s] for s in seats if table.seats[s].occupied()]

    if hascards is True:
        seatlist = list(filter((lambda x: x.has_hand() == True), seatlist))

    if haschips is True:
        seatlist = list(filter((lambda x: x.has_chips() == True), seatlist))

    return seatlist