def METHOD_NAME(proc, timeout=300):
    try:
        stdout, stderr = proc.communicate(timeout=timeout)
    except subprocess.TimeoutExpired:
        proc.kill()
        try:
            stdout, stderr = proc.communicate(timeout=timeout)
        except subprocess.TimeoutExpired:
            os.system("kill -9 {}".format(proc.pid))
            return None, b"Zombie detected?! Proc can't be killed due timeout!"
        stderr = (stderr or b"") + b"\n\nKilled due timeout\n"
    return stdout, stderr