Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write_events(self, events):
if not events:
return
stdout = sys.stdout
with self._lock:
for event in XMLEvent.format_events(events):
stdout.write(event)
stdout.flush()
def format_events(raw_events, time=None,
index=None, host=None, source=None, sourcetype=None,
stanza=None, unbroken=False, done=False):
return XMLEvent.format_events(XMLEvent(data, time=time,
index=index, host=host,
source=source,
sourcetype=sourcetype,
stanza=stanza, unbroken=unbroken,
done=done) for data in
raw_events)
def create_event(self, data, time=None,
index=None, host=None, source=None, sourcetype=None,
stanza=None, unbroken=False, done=False):
'''Create a new XMLEvent object.
'''
return XMLEvent(
data, time=time,
index=index, host=host, source=source, sourcetype=sourcetype,
stanza=stanza, unbroken=unbroken, done=done)