human
I am working on the file "09 Exceptions.ipynb".
The first task is:
try/finally Statement
The other flavor of the try statement is a specialization that has to do with finalization (a.k.a. termination) actions. If a finally clause is included in a try, Python will always run its block of statements “on the way out” of the try statement, whether an exception occurred while the try block was running or not. 
In it's general form, it is:
try:
    statements # Run this action first 
finally:
    statements # Always run this code on the way out
<a name="ctx"></a>
with/as Context Managers
Python 2.6 and 3.0 introduced a new exception-related statement—the with, and its optional as clause. This statement is designed to work with context manager objects, which support a new method-based protocol, similar in spirit to the way that iteration tools work with methods of the iteration protocol. 
Context Manager Intro
Basic Usage:
with expression [as variable]: 
    with-block
Classical Usage
```python
with open(r'C:\misc\data') as myfile: 
    for line in myfile:
        print(line)
    # ...more code here...
```
... even using multiple context managers:
python
with open('script1.py') as f1, open('script2.py') as f2: 
    for (linenum, (line1, line2)) in enumerate(zip(f1, f2)):
        if line1 != line2:
            print('%s\n%r\n%r' % (linenum, line1, line2))
How it works

The expression is evaluated,resulting in an object known as a context manager that must have __enter__ and __exit__ methods

The context manager’s __enter__ method is called. The value it returns is assigned to the variable in the as clause if present, or simply discarded otherwise

The code in the nested with block is executed.

If the with block raises an exception, the __exit__(type,value,traceback) method is called with the exception details. These are the same three values returned by sys.exc_info (Python function). If this method returns a false value, the exception is re-raised.
otherwise, the exception is terminated. The exception should normally be reraised so that it is propagated outside the with...
Can you write Python code for it?

What is a the Python code you requested?
assistant
#Here is the Python code you requested.

class TraceBlock:
    def message(self, arg):
        print('running ' + arg) 
        
    def __enter__(self):
        print('starting with block')
        return self
    
    def __exit__(self, exc_type, exc_value, exc_tb):
        if exc_type is None: 
            print('exited normally\n')
        else:
            print('raise an exception! ' + str(exc_type)) 
            return False # Propagate

with TraceBlock() as action: 
    action.message('test 1')
    print('reached')

with TraceBlock() as action: 
    action.message('test 2') 
    raise TypeError()
    print('not reached')