def _safe_value(obj, key, value):
 typ = obj._type(key)
 return (isinstance(typ, SAFE_TYPES) and isinstance(value, typ.model_type))

def _safe_value ( obj , key , value ) : typ = obj . _type ( key ) return ( isinstance ( typ , SAFE_TYPES ) and isinstance ( value , typ . model_type ) )
check whether the value is safe to represent in yaml and trust as returned from parsed yaml .