Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_output_handler(type_, collector, fn=None):
# just a little factory
if type_ in ("stdout", "stderr"):
return TextOutput(getattr(sys, type_), collector)
elif type_ == "pickle":
return PickleOutput(collector, fn=fn)
else:
raise NotImplementedError()