def lowercase_keys_recursively(subject):
 lowercased = dict()
 for (key, val) in subject.iteritems():
  if isinstance(val, dict):
   val = lowercase_keys_recursively(val)
  lowercased[key.lower()] = val
 return lowercased

def lowercase_keys_recursively ( subject ) : lowercased = dict ( ) for ( key , val ) in subject . iteritems ( ) : if isinstance ( val , dict ) : val = lowercase_keys_recursively ( val ) lowercased [ key . lower ( ) ] = val return lowercased
return a dict with all keys lowercased .