MCPcopy Index your code
hub / github.com/netdata/netdata / emit

Function emit

src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py:105–124  ·  view source on GitHub ↗

Emit YAML parsing events into a stream. If stream is None, return the produced string instead.

(events, stream=None, Dumper=Dumper,
        canonical=None, indent=None, width=None,
        allow_unicode=None, line_break=None)

Source from the content-addressed store, hash-verified

103 return load_all(stream, SafeLoader)
104
105def emit(events, stream=None, Dumper=Dumper,
106 canonical=None, indent=None, width=None,
107 allow_unicode=None, line_break=None):
108 """
109 Emit YAML parsing events into a stream.
110 If stream is None, return the produced string instead.
111 """
112 getvalue = None
113 if stream is None:
114 stream = io.StringIO()
115 getvalue = stream.getvalue
116 dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
117 allow_unicode=allow_unicode, line_break=line_break)
118 try:
119 for event in events:
120 dumper.emit(event)
121 finally:
122 dumper.dispose()
123 if getvalue:
124 return getvalue()
125
126def serialize_all(nodes, stream=None, Dumper=Dumper,
127 canonical=None, indent=None, width=None,

Callers 3

DirectTerminalFinalizerFunction · 0.85
tryFinalizeMethod · 0.85

Calls 3

DumperClass · 0.85
emitMethod · 0.45
disposeMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…