def METHOD_NAME(domain):
    from corehq.toggles import all_toggles, NAMESPACE_DOMAIN
    from corehq.toggles.models import Toggle
    from corehq.toggles.shortcuts import namespaced_item
    domain_item = namespaced_item(domain, NAMESPACE_DOMAIN)
    usernames = set(get_all_usernames_by_domain(domain))
    for toggle in all_toggles() + all_previews():
        try:
            current_toggle = Toggle.get(toggle.slug)
        except ResourceNotFound:
            continue
        enabled_for = set(current_toggle.enabled_users)
        new_toggle = Toggle(slug=toggle.slug, enabled_users=[])
        if domain_item in enabled_for:
            new_toggle.enabled_users.append(domain_item)
        enabled_users = enabled_for & usernames
        new_toggle.enabled_users.extend(list(enabled_users))
        if new_toggle.enabled_users:
            yield new_toggle.to_json()