def has_safe_repr(value):
 if ((value is None) or (value is NotImplemented) or (value is Ellipsis)):
  return True
 if isinstance(value, ((bool, int, float, complex, range_type, Markup) + string_types)):
  return True
 if isinstance(value, (tuple, list, set, frozenset)):
  for item in value:
   if (not has_safe_repr(item)):
    return False
  return True
 elif isinstance(value, dict):
  for (key, value) in iteritems(value):
   if (not has_safe_repr(key)):
    return False
   if (not has_safe_repr(value)):
    return False
  return True
 return False

def has_safe_repr ( value ) : if ( ( value is None ) or ( value is NotImplemented ) or ( value is Ellipsis ) ) : return True if isinstance ( value , ( ( bool , int , float , complex , range_type , Markup ) + string_types ) ) : return True if isinstance ( value , ( tuple , list , set , frozenset ) ) : for item in value : if ( not has_safe_repr ( item ) ) : return False return True elif isinstance ( value , dict ) : for ( key , value ) in iteritems ( value ) : if ( not has_safe_repr ( key ) ) : return False if ( not has_safe_repr ( value ) ) : return False return True return False
does the node have a safe representation? .