def key_has_dot_or_dollar(d):
 for (k, v) in d.items():
  if ((('.' in k) or ('$' in k)) or (isinstance(v, dict) and key_has_dot_or_dollar(v))):
   return True

def key_has_dot_or_dollar ( d ) : for ( k , v ) in d . items ( ) : if ( ( ( '.' in k ) or ( '$' in k ) ) or ( isinstance ( v , dict ) and key_has_dot_or_dollar ( v ) ) ) : return True
helper function to recursively determine if any key in a dictionary contains a dot or a dollar sign .