def get_dcs(scope: str, group: Optional[int]) -> AbstractDCS:
    """Get the DCS object.

    :param scope: cluster name.
    :param group: if *group* is defined, use it to select which alternative Citus group this DCS refers to. If *group*
        is ``None`` and a Citus configuration exists, assume this is the coordinator. Coordinator has the group ``0``.
        Refer to the module note for more details.

    :returns: a subclass of :class:`~patroni.dcs.AbstractDCS`, according to the DCS technology that is configured.

    :raises:
        :class:`PatroniCtlException`: if not suitable DCS configuration could be found.
    """
    if (scope, group) in __dcs_cache:
        return __dcs_cache[(scope, group)]
    config = _get_configuration()
    config.update({'scope': scope, 'patronictl': True})
    if group is not None:
        config['citus'] = {'group': group, 'database': 'postgres'}
    config.setdefault('name', scope)
    try:
        dcs = _get_dcs(config)
        if is_citus_cluster() and group is None:
            dcs.is_mpp_coordinator = lambda: True
        click.get_current_context().obj['__mpp'] = dcs.mpp
        __dcs_cache[(scope, group)] = dcs
        return dcs
    except PatroniException as e:
        raise PatroniCtlException(str(e))
Get the DCS object.

    :param scope: cluster name.
    :param group: if *group* is defined, use it to select which alternative Citus group this DCS refers to. If *group*
        is ``None`` and a Citus configuration exists, assume this is the coordinator. Coordinator has the group ``0``.
        Refer to the module note for more details.

    :returns: a subclass of :class:`~patroni.dcs.AbstractDCS`, according to the DCS technology that is configured.

    :raises:
        :class:`PatroniCtlException`: if not suitable DCS configuration could be found.
    
patroni/ctl.py