def capture_output(command, args=[], kwargs={}):
<EOL>output = StringIO()<EOL>sys.stdout = output<EOL>command(*args, **kwargs)<EOL>sys.stdout = sys.__stdout__<EOL>return output.getvalue()<EOL>
captures standard output