code: def error_handler(func):
      def wrapper(*args, **kwargs):
          onerror = kwargs.get("onerror", None)
          result = {}
  
          try:
              vals = func(*args, **kwargs)
              if vals:
                  result["data"] = vals
          except Exception as e:  # noqa: BLE001
              if onerror is not None:
                  onerror(result, e, **kwargs)
          return result
  
      return wrapper
  
imports: import hashlib
  import json
  import os
  import re
  import sys
  from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Tuple
  import colorama
label_desc: Use image node_id 22 for calling a global function with example usage: error_handler(func) and returns: wrapper, result