def parse(
        cls,
        source: Mapping[str, Any] | list,
        strict: bool = True,
        extra_keys: Sequence[str] = tuple(),
    ):
        """
        Override parse function to perform validations that require considering all
        argument declarations at once.
        """
        try:
            result = tuple(super().parse(source, strict, extra_keys))
        except ConfigValidationError as error:
            PoeTaskArgs._enrich_config_error(error, cast(ArgsDef, source))
            raise

        if strict:
            arg_names = set()
            positional_multiple = None
            for arg in result:
                if arg.name in arg_names:
                    raise ConfigValidationError(
                        f"Duplicate argument name {arg.name!r}",
                        context=f"Invalid argument {arg.name!r} declared",
                    )
                arg_names.add(arg.name)

                if arg.positional:
                    if positional_multiple:
                        raise ConfigValidationError(
                            f"Only the last positional arg of task may accept"
                            f" multiple values (not {positional_multiple!r}).",
                            context=f"Invalid argument {arg.name!r} declared",
                        )
                    if arg.multiple:
                        positional_multiple = arg.name
        yield from result

        Override parse function to perform validations that require considering all
        argument declarations at once.
        
poethepoet/task/args.py