def _handle_default(k, v=None):
 this_mapping = deepcopy(DEFAULTS[k])
 if (v is not None):
  if isinstance(v, dict):
   this_mapping.update(v)
  else:
   for key in this_mapping.keys():
    this_mapping[key] = v
 return this_mapping

def _handle_default ( k , v = None ) : this_mapping = deepcopy ( DEFAULTS [ k ] ) if ( v is not None ) : if isinstance ( v , dict ) : this_mapping . update ( v ) else : for key in this_mapping . keys ( ) : this_mapping [ key ] = v return this_mapping
avoid dicts as default keyword arguments .