code: def timed_predictor(f):
      """
      Intended to be called from within lightwood predictor methods.
      We use `wraps` to pass metadata into debuggers (as in stackoverflow.com/a/27737385)
      """
  
      @wraps(f)
      def wrap(predictor, *args, **kw):
          ts = time()
          result = f(predictor, *args, **kw)
          te = time()
          log.debug(
              f" `{f.__name__}` runtime: {round(te - ts, 2)} seconds"
          )
          if hasattr(predictor, "runtime_log"):
              predictor.runtime_log[
                  (f.__name__, datetime.fromtimestamp(ts))
              ] = round(te - ts, 2)
          return result
  
      return wrap
  
file_path: lightwood/lightwood/helpers/log.py
imports: import os
  import logging
  import colorlog
  from time import time
  from datetime import datetime
  from functools import wraps
label_desc: Use image node_id 2 for calling a global function with example usage: timed_predictor(f) and returns: wrap, result