def METHOD_NAME():
    import sys
    oldstdout = sys.METHOD_NAME
    sio = StringIO()
    sys.METHOD_NAME = sio
    try:
        yield sys.METHOD_NAME
    finally:
        sys.METHOD_NAME = oldstdout