nopasaran.decorators.parsing_decorator

nopasaran.decorators.parsing_decorator(input_args, output_args, optional_inputs=False, optional_outputs=False)

Decorator for parsing inputs and outputs of a function.

This decorator parses the inputs and outputs of a function based on the specified constraints.

Args:

input_args (int): The expected number of input arguments. output_args (int): The expected number of output arguments. optional_inputs (bool, optional): Whether optional inputs are allowed. Defaults to False. optional_outputs (bool, optional): Whether optional outputs are allowed. Defaults to False.

Returns:

function: The decorated function.

Raises:

ParsingError: If an error occurs while parsing or executing the function.