def is_org_member(client, username, org_name, public=False):
    """
    client must either be a client for the given username or a client with admin privileges for the org.
    public - whether the user is a public org member
    """
    members = 'public_members' if public else 'members'
    return client.orgs._(org_name)._(members)._(username).get().status_code == 204