def _get_event_spec_from_args_spec(name: str, event: EventChain) -> Callable:
        """Get the event spec from the args spec.

        Args:
            name: The name of the event
            event: The args spec.

        Returns:
            The event spec.
        """

        def fn(*args):
            return run_script(Var(name).to(FunctionVar).call(*args))

        if event.args_spec:
            arg_spec = (
                event.args_spec
                if not isinstance(event.args_spec, Sequence)
                else event.args_spec[0]
            )
            names = inspect.getfullargspec(arg_spec).args
            fn.__signature__ = inspect.Signature(  # pyright: ignore[reportFunctionMemberAccess]
                parameters=[
                    inspect.Parameter(
                        name=name,
                        kind=inspect.Parameter.POSITIONAL_ONLY,
                        annotation=arg._var_type,
                    )
                    for name, arg in zip(
                        names, parse_args_spec(event.args_spec)[0], strict=True
                    )
                ]
            )

        return fn
Get the event spec from the args spec.

        Args:
            name: The name of the event
            event: The args spec.

        Returns:
            The event spec.
        
reflex/components/component.py