code: def delegates_kwargs(to=None, keep=False):
      "Decorator: replace `**kwargs` in signature with params from `to`"
  
      def _f(f):
          from_f = f.__init__ if to is None else f
          sig = inspect.signature(from_f)
          sigd = dict(sig.parameters)
          k = sigd.pop("kwargs")
          if to is None:
              for base_cls in f.__bases__:
                  to_f = base_cls.__init__
                  s2 = {
                      k: v
                      for k, v in inspect.signature(
                          to_f
                      ).parameters.items()
                      if v.default != inspect.Parameter.empty
                      and k not in sigd
                  }
                  sigd.update(s2)
          else:
              to_f = to
              s2 = {
                  k: v
                  for k, v in inspect.signature(to_f).parameters.items()
                  if v.default != inspect.Parameter.empty
                  and k not in sigd
              }
              sigd.update(s2)
          if keep:
              sigd["kwargs"] = k
          from_f.__signature__ = sig.replace(parameters=sigd.values())
          return f
  
      return _f
  
imports: import sys
  from abc import ABC
  import inspect
  import types
  from typing import Union, List, Tuple
  from pathlib import Path
  from importlib import import_module
  import socket
  import dash
  from dash import html, dcc, Input, Output, State
  from dash.exceptions import PreventUpdate
  import dash_bootstrap_components
  from .None import to_html
label_desc: Use image node_id 1 for calling a global function with example usage: delegates_kwargs(to, keep) and returns: _f, f