code: def initvars(
      obj: object,
      include_defaults: bool = False,
      include_kwargs: bool = False,
      include_properties: bool = False,
  ) -> Dict[Any, Any]:
      """Return object __dict__ variables that was passed throw constructor (__init__ method).
  
      Parameters
      ----------
      obj : object
      include_defaults : bool, default False
          wherether to include vars with default value or not
  
      Returns
      -------
      Dict[Any, Any] subset of the obj __dict__
      """
      assert hasattr(obj, "__init__")
      state = {
          k: v for k, v in obj.__dict__.items() if not k.startswith("_")
      }
      signature = extract_signature(
          obj.__init__
      )  # pylint: disable=redefined-outer-name
      bind = signature.bind(**state)
  
      if include_defaults is True:
          bind.apply_defaults()
          arguments = bind.arguments
      else:
          arguments = {
              k: v
              for k, v in bind.arguments.items()
              if signature.parameters[k].default != v
          }
  
      if not include_kwargs:
          arguments.pop("kwargs", None)
  
      if not include_properties:
          arguments.pop("properties_list", None)
          arguments.pop("image_properties", None)
          arguments.pop("label_properties", None)
          arguments.pop("prediction_properties", None)
  
      return arguments
  
imports: from functools import lru_cache
  from inspect import Signature, signature
  from typing import Any, Callable, Dict
label_desc: Use image node_id 2 for calling a global function with example usage: initvars(obj, include_defaults, include_kwargs, include_properties) and returns: arguments