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