Registers a function to the display hook queue to be called on hook.
    Look at the sys.displayhook documentation for more information.
    
    :param      func | <callable>
436221
def registerDisplay(func):
    
    setup()
    ref = weakref.ref(func)
    if ref not in _displayhooks:
        _displayhooks.append(ref)
481202
def register_postparsing_hook(self, func: Callable[[plugin.PostparsingData], plugin.PostparsingData]) -> None:
        """"""
        self._validate_postparsing_callable(func)
        self._postparsing_hooks.append(func)
1212195
def call_decorator(cls, func):
        

        @wraps(func)
        def _wrap(self, *args, **kwargs):
            try:
                return func(self, *args, **kwargs)
            except Exception:
                self.logger.exception('While executing benchmark')
                if not (self.catch_child_exception or False):
                    raise

        return _wrap
350652
def add_task(self, func, *args, **kargs):
        
        self.tasks_queue.put((func, args, kargs))
3467
def register(self, func, *args, **kwargs):
        
        self._open[-1].append(UndoOperation(func, *args, **kwargs))
        if not (self._undoing or self._redoing):
            self._redo = []
        self.notify()
1204628
def register_callback_reassigned(self, func, serialised=True):
        
        self.__add_callback(_CB_REASSIGNED, func, serialised_if_crud=serialised)
237596
def register_function(self, specification, function, scope=None):
        
        self.register_provider(
            specification,
            FunctionProvider(function, scope=scope)
        )
388059
def gcall(func, *args, **kwargs):
    
    def idle():
        with gdk.lock:
            return bool(func(*args, **kwargs))
    return gobject.idle_add(idle)
296754
def register(style, func=None):
    
    if func is not None:
        _registry[style] = func
        return

    def decorator(func):
        _registry[style] = func

        @wraps(func)
        def wrapper(pinyin, **kwargs):
            return func(pinyin, **kwargs)

        return wrapper
    return decorator
761298
def pre_run_hook(self, func, prefix=None):
        
        cf = self.capture(func, prefix=prefix)
        self.pre_run_hooks.append(cf)
        return cf
97546
def add_thread(self, func, interval):
        
        t = Thread(func, interval, self.output_dict)
        t.start()
        self._thread_pool.append(t)
398642
def set_callback(self, func):
        

        if isinstance(func, str if py3k else basestring) and func:
            self.arguments.update({'callback': '%s' % func})
        else:
            raise TwitterSearchException(1006)
452963
function wrap(func) {
  if (!util.is('Function', func)) { func = function noop(){}; }

  return function wrapper() {
    try {
      return func.apply(this, arguments);
    } catch(err) {
      this.notify(err, {stackShift: 3});
      throw(err);
    }
  }.bind(this);
}
327529
def register_function(self, name: Optional[str]=None):
        
        def wrap(function: Callable)->Any:
            nonlocal name
            if name is None:
                name = function.__name__
            self.funcs[name] = function
            return function
        return wrap
279138
def function_call_action(self, text, loc, fun):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("FUN_CALL:",fun)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        #check number of arguments
        if len(self.function_arguments) != self.symtab.get_attribute(self.function_call_index):
            raise SemanticException("Wrong number of arguments for function '%s'" % fun.name)
        #arguments should be pushed to stack in reverse order
        self.function_arguments.reverse()
        self.codegen.function_call(self.function_call_index, self.function_arguments)
        self.codegen.restore_used_registers()
        return_type = self.symtab.get_type(self.function_call_index)
        #restore previous function call data
        self.function_call_index = self.function_call_stack.pop()
        self.function_arguments = self.function_arguments_stack.pop()
        register = self.codegen.take_register(return_type)
        #move result to a new free register, to allow the next function call
        self.codegen.move(self.codegen.take_function_register(return_type), register)
        return register
505613
def entry_point(__func: Callable) -> Callable:
    
    if __func.__module__ == '__main__':
        import sys
        sys.exit(__func())
    else:
        return __func
213257
def decorate(self, func, target, *anoop, **kwnoop):
        
        if target:
            self.target = target

        def decorated(decorated_self, *args, **kwargs):
            self.handle_target(
                request=decorated_self.request,
                controller_args=args,
                controller_kwargs=kwargs
            )
            return func(decorated_self, *args, **kwargs)

        return decorated