def METHOD_NAME(
    tag,
    data=None,
    preload=None,
    with_env=False,
    with_grains=False,
    with_pillar=False,
    with_env_opts=False,
    **kwargs
):
    """
    Send an event to the Salt Master
    .. versionadded:: 2014.7.0
    :param tag: A tag to give the event.
        Use slashes to create a namespace for related events. E.g.,
        ``myco/build/buildserver1/start``, ``myco/build/buildserver1/success``,
        ``myco/build/buildserver1/failure``.
    :param data: A dictionary of data to send in the event.
        This is free-form. Send any data points that are needed for whoever is
        consuming the event. Arguments on the CLI are interpreted as YAML so
        complex data structures are possible.
    :param with_env: Include environment variables from the current shell
        environment in the event data as ``environ``.. This is a short-hand for
        working with systems that seed the environment with relevant data such
        as Jenkins.
    :type with_env: Specify ``True`` to include all environment variables, or
        specify a list of strings of variable names to include.
    :param with_grains: Include grains from the current minion in the event
        data as ``grains``.
    :type with_grains: Specify ``True`` to include all grains, or specify a
        list of strings of grain names to include.
    :param with_pillar: Include Pillar values from the current minion in the
        event data as ``pillar``. Remember Pillar data is often sensitive data
        so be careful. This is useful for passing ephemeral Pillar values
        through an event. Such as passing the ``pillar={}`` kwarg in
        :py:func:`state.sls <salt.modules.state.sls>` from the Master, through
        an event on the Minion, then back to the Master.
    :type with_pillar: Specify ``True`` to include all Pillar values, or
        specify a list of strings of Pillar keys to include. It is a
        best-practice to only specify a relevant subset of Pillar data.
    :param with_env_opts: Include ``saltenv`` and ``pillarenv`` set on minion
        at the moment when event is send into event data.
    :type with_env_opts: Specify ``True`` to include ``saltenv`` and
        ``pillarenv`` values or ``False`` to omit them.
    :param kwargs: Any additional keyword arguments passed to this function
        will be interpreted as key-value pairs and included in the event data.
        This provides a convenient alternative to YAML for simple values.
    CLI Example:
    .. code-block:: bash
        salt-call event.send myco/mytag foo=Foo bar=Bar
        salt-call event.send 'myco/mytag' '{foo: Foo, bar: Bar}'
    """
    data_dict = {}
    if with_env:
        if isinstance(with_env, list):
            data_dict["environ"] = _dict_subset(with_env, dict(os.environ))
        else:
            data_dict["environ"] = dict(os.environ)
    if with_grains:
        if isinstance(with_grains, list):
            data_dict["grains"] = _dict_subset(with_grains, __grains__)
        else:
            data_dict["grains"] = __grains__.value()
    if with_pillar:
        if isinstance(with_pillar, list):
            data_dict["pillar"] = _dict_subset(with_pillar, __pillar__)
        else:
            data_dict["pillar"] = __pillar__.value()
    if with_env_opts:
        data_dict["saltenv"] = __opts__.get("saltenv", "base")
        data_dict["pillarenv"] = __opts__.get("pillarenv")
    if kwargs:
        data_dict.update(kwargs)
    # Allow values in the ``data`` arg to override any of the above values.
    if isinstance(data, Mapping):
        data_dict.update(data)
    if (
        __opts__.get("local")
        or __opts__.get("file_client") == "local"
        or __opts__.get("master_type") == "disable"
    ) and not __opts__.get("use_master_when_local"):
        return fire(data_dict, tag)
    else:
        return fire_master(data_dict, tag, preload=preload)