def add_postprocessor(
    postprocessors_function_name, _postprocessors, module, attributes
):
    """
    Add the postprocessor to the appropriate _methods dictionary and to the module.
    Parameters
    ----------

    postprocessors_function_name: str
        for example, e.g. diagnostic_example1
    _postprocessors: function
        the function to be added
    @param module: the module where the function is added, e.g. 'diagnostics'
    @param attributes: the existing functions in the selected module
    """
    # the dictionary where the function is added
    methods_dict = (
        _diagnostics_methods if "diagnostic" in module else _ensemblestats_methods
    )

    # get funtion name without mo
    short_name = postprocessors_function_name.replace(f"{module}_", "")
    if short_name not in methods_dict:
        methods_dict[short_name] = _postprocessors
    else:
        warnings.warn(
            f"The {module} identifier '{short_name}' is already available in "
            f"'pysteps.postprocessing.interface_{module}_methods'.\n"
            f"Skipping {module}:{'.'.join(attributes)}",
            RuntimeWarning,
        )

    if hasattr(globals()[module], postprocessors_function_name):
        warnings.warn(
            f"The {module} function '{short_name}' is already an attribute"
            f"of 'pysteps.postprocessing.{module}'.\n"
            f"Skipping {module}:{'.'.join(attributes)}",
            RuntimeWarning,
        )
    else:
        setattr(globals()[module], postprocessors_function_name, _postprocessors)
Add the postprocessor to the appropriate _methods dictionary and to the module.
Parameters
----------

postprocessors_function_name: str
for example, e.g. diagnostic_example1
_postprocessors: function
the function to be added
@param module: the module where the function is added, e.g. 'diagnostics'
@param attributes: the existing functions in the selected module
pysteps/postprocessing/interface.py