def get_members(client):
    """
    Use pagination to fetch list of member accounts
    """
    response = client.list_members()
    members = []
    while response:
        members += response["Members"]
        if "NextToken" in response:
            response = client.list_members(NextToken=response["NextToken"])
        else:
            response = None

    accounts = []
    for member in members:
        accounts.append(member["AccountId"])
    # print(accounts)
    return accounts