 The with statement ( from Python 2 @.@ 5 ) , which encloses a code block within a context manager ( for example , acquiring a lock before the block of code is run and releasing the lock afterwards , or opening a file and then closing it ) , allowing Resource Acquisition Is Initialization ( RAII ) -like behavior . 
