code: def on_end_epoch(func):
      """The :func:`on_end_epoch` decorator is used to initialise a :class:`.Callback` with :meth:`~.Callback.on_end_epoch`
      calling the decorated function
  
      Example: ::
  
          >>> import torchbearer
          >>> from torchbearer import Trial
          >>> from torchbearer.callbacks import on_end_epoch
  
          # Example callback running each epoch
          >>> @on_end_epoch
          ... def print_callback(state):
          ...     print('Finished epoch {}.'.format(state[torchbearer.EPOCH]))
  
          >>> trial = Trial(None, callbacks=[print_callback]).for_steps(1).run()
          Finished epoch 0.
  
      Args:
          func (function): The function(state) to *decorate*
  
      Returns:
          Callback: Initialised callback with :meth:`~.Callback.on_end_epoch` calling func
      """
      return bind_to(Callback.on_end_epoch)(func)
  
imports: import sys
  import types
  import torchbearer
  from torchbearer.callbacks import Callback
label_desc: Use image node_id 12 for calling a global function with example usage: on_end_epoch(func) and returns: bind_to