code: def default_for_key(key, *args, **kwargs):
      """The :func:`default_for_key` decorator will register the given metric in the global metric dict
      (`metrics.DEFAULT_METRICS`) so that it can be referenced by name in instances of :class:`.MetricList` such as in the
      list given to the :class:`.torchbearer.Model`.
  
      Example: ::
  
          @default_for_key('acc')
          class CategoricalAccuracy(metrics.BatchLambda):
              ...
  
      Args:
          key (str): The key to use when referencing the metric
          args: Any args to pass to the underlying metric when constructed
          kwargs: Any keyword args to pass to the underlying metric when constructed
      """
  
      def decorator(arg):
          add_default(key, arg, *args, **kwargs)
          return arg
  
      return decorator
  
file_path: torchbearer/torchbearer/metrics/decorators.py
imports: import inspect
  from torchbearer.metrics import EpochLambda, BatchLambda, ToDict, Mean, MetricTree, Std, Var, RunningMean
  from .metrics import add_default
label_desc: Use image node_id 1 for calling a global function with example usage: default_for_key(key) and returns: decorator, arg