class_docstr: Base class for all configuration classes. Handles a few parameters common to all models' configurations as well as
  methods for loading/downloading/saving configurations.
class_docstr_tok: ["Base","class","for","all","configuration","classes",".","Handles","a","few","parameters","common","to","all","models","'","configurations","as","well","as","methods","for","loading\/downloading\/saving","configurations","."]
code: def extract_init_dict(cls, config_dict, **kwargs):
      expected_keys = set(
          dict(inspect.signature(cls.__init__).parameters).keys()
      )
      expected_keys.remove("self")
      # remove general kwargs if present in dict
      if "kwargs" in expected_keys:
          expected_keys.remove("kwargs")
      # remove keys to be ignored
      if len(cls.ignore_for_config) > 0:
          expected_keys = expected_keys - set(cls.ignore_for_config)
      init_dict = {}
      for key in expected_keys:
          if key in kwargs:
              # overwrite key
              init_dict[key] = kwargs.pop(key)
          elif key in config_dict:
              # use value from config dict
              init_dict[key] = config_dict.pop(key)
  
      unused_kwargs = config_dict.update(kwargs)
  
      passed_keys = set(init_dict.keys())
      if len(expected_keys - passed_keys) > 0:
          logger.warning(
              f"{expected_keys - passed_keys} was not found in config. Values will be initialized to default values."
          )
  
      return init_dict, unused_kwargs
  
imports: import functools
  import inspect
  import json
  import os
  import re
  from collections import OrderedDict
  from typing import Any
  from typing import Dict
  from typing import Tuple
  from typing import Union
  from requests import HTTPError
  from paddlehub.common.logger import logger
label_desc: Use image node_id 5 for calling the ConfigMixin obj's underlying member method code with example usage: obj.extract_init_dict(cls, config_dict) and returns: init_dict,  unused_kwargs