def METHOD_NAME(command: CommandPayloadCreator) -> Callable[[FuncT], FuncT]:
    """Publish messages before and after the decorated function has run."""
    def _decorator(func: FuncT) -> FuncT:
        @functools.wraps(func)
        def _decorated(*args: Any, **kwargs: Any) -> Any:
            """Use the args passed to wrapped `func` to build the message payload.
            1. Inspect signature of `func` and bind arguments to signature to map
               argument names to called (and/or default) values.
            2. Inspect signature of `command` and map values from `func` call to
               argument names expected by `command`.
            3. Map `self` argument of `func` to the `instrument` argument of `command`,
               where applicable.
            4. Construct the command payload and publish it using `publish_context`
            5. Return the value of calling `func` with `*args` and `**kwargs`
            """
            broker = getattr(args[0], "broker", None)
            assert isinstance(
                broker, Broker
            ), "Only methods of CommandPublisher classes should be decorated."
            func_sig = _inspect_signature(func)
            bound_func_args = func_sig.bind(*args, **kwargs)
            bound_func_args.apply_defaults()
            func_args = bound_func_args.arguments
            message_creator_sig = _inspect_signature(command)
            message_creator_arg_names = set(message_creator_sig.parameters.keys())
            message_creator_args = {
                n: func_args[n] for n in message_creator_arg_names if n in func_args
            }
            # TODO (artyom, 20170927): we are doing this to be able to use
            # the decorator in Instrument class methods, in which case
            # self is effectively an instrument.
            # To narrow the scope of this hack, we are checking if the
            # command is expecting instrument first.
            # We are also checking if call arguments have 'self' and
            # don't have instruments specified, in which case
            # instruments should take precedence.
            if (
                "instrument" in message_creator_arg_names
                and "instrument" not in message_creator_args
                and "self" in func_args
            ):
                message_creator_args["instrument"] = func_args["self"]
            command_message = command(**message_creator_args)
            with publish_context(broker=broker, command=command_message):
                return func(*args, **kwargs)
        return cast(FuncT, _decorated)
    return _decorator