def emit(events, stream=None, Dumper=Dumper,
        canonical=None, indent=None, width=None,
        allow_unicode=None, line_break=None):
    """
    Emit YAML parsing events into a stream.
    If stream is None, return the produced string instead.
    """
    getvalue = None
    if stream is None:
        try:
            from cStringIO import StringIO
        except __HOLE__:
            from StringIO import StringIO
        stream = StringIO()
        getvalue = stream.getvalue
    dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
            allow_unicode=allow_unicode, line_break=line_break)
    for event in events:
        dumper.emit(event)
    if getvalue:
        return getvalue()
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/yaml/lib/yaml/__init__.py/emit