code: def decorate_check_error(error_enum):
      """Decorator to call `check_error` on the return value."""
  
      def decorator(func):
          @functools.wraps(func)
          def _check_error(*args, **kwargs):
              return check_error(func(*args, **kwargs), error_enum)
  
          return _check_error
  
      return decorator
  
imports: import copy
  import functools
  import socket
  import sys
  import time
  from absl import flags
  from absl import logging
  from pysc2.lib import protocol
  from pysc2.lib import static_data
  from pysc2.lib import stopwatch
  import websocket
  from s2clientprotocol import debug_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: decorate_check_error(error_enum) and returns: decorator, _check_error, check_error