import re
from typing import Dict


def _combine_args_sections(*args_sections: str) -> str:
    """Combine 'Args' sections from multiple functions into one section, removing any duplicates"""
    # Ensure one line per arg
    args_section = '\n'.join(args_sections).strip()
    args_section = re.sub('\n\\s+', ' ', args_section)

    # Split into key-value pairs to remove any duplicates; if so, keep the first one
    args: Dict[str, str] = {}
    for line in args_section.splitlines():
        k, v = line.split(':', 1)
        args.setdefault(k.strip(), v.strip())

    return '\n'.join([f'    {k}: {v}' for k, v in args.items()])