def yaml_dump(data, stream=None, dumper=yaml.Dumper, **kwargs):
 class Dumper(dumper, ):
  u'Custom dumper.'
 if (not PY3):
  Dumper.add_representer(unicode, (lambda dumper, value: dumper.represent_scalar(u'tag:yaml.org,2002:str', value)))
 return yaml.dump(data, stream, Dumper, **kwargs)

def yaml_dump ( data , stream = None , dumper = yaml . Dumper , ** kwargs ) : class Dumper ( dumper , ) : if ( not PY3 ) : Dumper . add_representer ( unicode , ( lambda dumper , value : dumper . represent_scalar ( u'tag:yaml.org,2002:str' , value ) ) ) return yaml . dump ( data , stream , Dumper , ** kwargs )
dump object to string .