def local_over_kwdict(local_var, kwargs, *keys):
 out = local_var
 for key in keys:
  kwarg_val = kwargs.pop(key, None)
  if (kwarg_val is not None):
   if (out is None):
    out = kwarg_val
   else:
    warnings.warn((u'"%s" keyword argument will be ignored' % key), IgnoredKeywordWarning)
 return out

def local_over_kwdict ( local_var , kwargs , * keys ) : out = local_var for key in keys : kwarg_val = kwargs . pop ( key , None ) if ( kwarg_val is not None ) : if ( out is None ) : out = kwarg_val else : warnings . warn ( ( u'"%s" keyword argument will be ignored' % key ) , IgnoredKeywordWarning ) return out
enforces the priority of a local variable over potentially conflicting argument(s) from a kwargs dict .