human
Complete this python program:
def make_extension(trigger=None, default_name=None, priority=None, finalizer=None, initializer=None, **kwargs):
assistant
#Here is the Python code you requested.

    """Decorator to make given functions into trainer extensions.
    This decorator just adds some attributes to a given function. The value of
    the attributes are given by the arguments of this decorator.
    See :class:`Extension` for details of trainer extensions. Most of the
    default values of arguments also follow those for this class.
    Args:
    trigger: Default trigger of the extension.
    default_name: Default name of the extension. The name of a given
    function is used by default.
    priority (int): Default priority of the extension.
    finalizer: Finalizer function of this extension. It is
    called at the end of the training loop.
    initializer: Initializer function of this extension. It is called at
    the beginning of the training loop.
    """
    msg = 'invoke_before_training    has    been    removed    since    Chainer    v2.0.0.    Use    initializer=    instead.'
    argument.check_unexpected_kwargs(kwargs, invoke_before_training=msg)
    argument.assert_kwargs_empty(kwargs)
    if (trigger is None):
        trigger = Extension.trigger
    if (priority is None):
        priority = Extension.priority
    def decorator(ext):
        ext.trigger = trigger
        ext.default_name = (default_name or ext.__name__)
        ext.priority = priority
        ext.finalize = finalizer
        ext.initialize = initializer
        return ext
    return decorator