def disconnect_remote_events(from_api, to_api):
    data = {
        'host': to_api.host,
        'port': to_api.port
    }

    try:
        req = from_api(METHOD_DELETE, URL_API_EVENT_FORWARD, data)

        if req.status_code == 200:
            return True
        else:
            _LOGGER.error(
                "Error removing event forwarding: %s - %s",
                req.status_code, req.text)

            return False

    except HomeAssistantError:
        _LOGGER.exception("Error removing an event forwarder")
        return False
Custom user data should be synced when the user is updated
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/remote.py/disconnect_remote_events--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/callcenter/tests/test_utils.py/CallCenterUtilsUserCaseTests.test_sync_usercase_custom_user_data_on_update