def position(table, _seat, postflop=False):
    """ Returns how many seats from the button the seat is. """
    # Raise an exception if the button is not set

    if postflop:
        seats = table.get_players(hascards=True)
    else:
        seats = table.get_players()

    return len(seats) - seats.index(_seat) - 1