def METHOD_NAME():
    tf = tarfile.open("/tmp/test.tar", "w")  # [consider-using-with]
    tf.close()
    with tarfile.open("/tmp/test.tar", "w"):  # must not trigger
        pass
    tf = tarfile.TarFile("/tmp/test2.tar", "w")  # [consider-using-with]
    tf.close()
    with tarfile.TarFile("/tmp/test2.tar", "w"):  # must not trigger
        pass