def METHOD_NAME(*args, **kwargs):
    """Emulate print option but get output in a ```str``` variable instead of
    stdout."""
    # Change the output to capture the string instead of sending it to the console
    old_stdout = sys.stdout
    sys.stdout = newstdout = StringIO()  # capture all print
    try:
        print(*args, **kwargs)
        string = newstdout.getvalue()  # Get string output
    except:
        raise
    finally:
        sys.stdout = old_stdout
    # discard line return character (will be added again when we print ``string`` )
    return string[:-1]