def key_not_string(d):
 for (k, v) in d.items():
  if ((not isinstance(k, six.string_types)) or (isinstance(v, dict) and key_not_string(v))):
   return True

def key_not_string ( d ) : for ( k , v ) in d . items ( ) : if ( ( not isinstance ( k , six . string_types ) ) or ( isinstance ( v , dict ) and key_not_string ( v ) ) ) : return True
helper function to recursively determine if any key in a dictionary is not a string .