def METHOD_NAME(p):
    try:
        outs, errs = p.communicate(timeout=2)
        print("stdout:")
        print(outs)
        print("stderr:")
        print(errs)
    except subprocess.TimeoutExpired:
        print("Failed to get process output")