def choose_master_channel(data: DataModel):
    channel_names, channel_ids = data.get_master_lists()

    list_widget = KeyValueBullet(prompt=_("1. Choose master channel"),
                                 choices=channel_names,
                                 choices_id=channel_ids)

    default_idx = None
    default_instance = ''
    if "master_channel" in data.config and data.config['master_channel']:
        default_config = data.config['master_channel'].split("#")
        default_id = default_config[0]
        if len(default_config) > 1:
            default_instance = default_config[1]
        with suppress(ValueError):
            default_idx = channel_ids.index(default_id)

    chosen_channel_name, chosen_channel_id = list_widget.launch(default=default_idx)

    chosen_instance = input(_("Instance name to use with {channel_name}: [{default_instance}]")
                            .format(channel_name=chosen_channel_name,
                                    default_instance=default_instance or _("default instance"))
                            + " ").strip()
    if chosen_instance:
        chosen_channel_id += "#" + chosen_instance
    data.config['master_channel'] = chosen_channel_id