original_docstring: Recursively overrides all key-values in default_config matching those in new_config
docstring: Recursively overrides all key-values in default_config matching those in new_config
docstring_tokens: Recursively overrides all key - values in default_config matching those in new_config
code: def _override_config(default_config, new_config, prefix=None):
      '''Recursively overrides all key-values in default_config matching those in new_config'''
      if prefix is None:
          prefix = []
  
      for key in new_config.keys():
          if isinstance(new_config[key], dict):
              p = prefix[:]
              p.append(key)
              _override_config(default_config, new_config[key], p)
          else:
              subdict = default_config
              has_prefix = True
              for k in prefix:
                  if k not in subdict.keys() or not isinstance(subdict[k], dict):
                      has_prefix = False
                      subdict[k] = {}
                  subdict = subdict[k]
              if not has_prefix or key not in subdict:
                  logging.warning("Creating new config key: {}".format(prefix + [key]))
              subdict[key] = new_config[key]
code_tokens: def _override_config ( default_config , new_config , prefix = None ) : if prefix is None : prefix = [ ] for key in new_config . keys ( ) : if isinstance ( new_config [ key ] , dict ) : p = prefix [ : ] p . append ( key ) _override_config ( default_config , new_config [ key ] , p ) else : subdict = default_config has_prefix = True for k in prefix : if k not in subdict . keys ( ) or not isinstance ( subdict [ k ] , dict ) : has_prefix = False subdict [ k ] = { } subdict = subdict [ k ] if not has_prefix or key not in subdict : logging . warning ( "Creating new config key: {}" . format ( prefix + [ key ] ) ) subdict [ key ] = new_config [ key ]
short_docstring: Recursively overrides all key-values in default_config matching those in new_config
short_docstring_tokens: Recursively overrides all key - values in default_config matching those in new_config
comment: '''Recursively overrides all key-values in default_config matching those in new_config'''