from typing import Dict


def get_config_pipeline(user_cfg: Dict[str, dict]) -> Dict[str, dict]:
    """
    Get the pipeline configuration

    :param user_cfg: user configuration
    :type user_cfg: dict
    :return cfg: partial configuration
    :rtype cfg: dict
    """

    cfg = {}

    if 'invalid_disparity' in user_cfg:
        cfg['invalid_disparity'] = user_cfg['invalid_disparity']
    if 'stereo' in user_cfg:
        cfg['stereo'] = user_cfg['stereo']
    if 'aggregation' in user_cfg:
        cfg['aggregation'] = user_cfg['aggregation']
    if 'optimization' in user_cfg:
        cfg['optimization'] = user_cfg['optimization']
    if 'refinement' in user_cfg:
        cfg['refinement'] = user_cfg['refinement']
    if 'filter' in user_cfg:
        cfg['filter'] = user_cfg['filter']
    if 'validation' in user_cfg:
        cfg['validation'] = user_cfg['validation']

    return cfg