human
I am working on the file "Box Python SDK.ipynb".
The first task is:
The Python SDK is organized into layers:
* The network layer, responsible for making network calls.
* The session layer, responsible for auth and retrying calls.
* The client layer, which is the interface to your application.
For demonstration purposes, I'm subclassing the default network layer to log network requests and responses.
Can you write Python program for it?
 What is a the Python program you requested?
assistant
#Here is the Python program you requested.

from boxsdk.network.default_network import DefaultNetwork
from pprint import pformat

class LoggingNetwork(DefaultNetwork):
    def request(self, method, url, access_token, **kwargs):
        """ Base class override. Pretty-prints outgoing requests and incoming responses. """
        print '\x1b[36m{} {} {}\x1b[0m'.format(method, url, pformat(kwargs))
        response = super(LoggingNetwork, self).request(
            method, url, access_token, **kwargs
        )
        if response.ok:
            print '\x1b[32m{}\x1b[0m'.format(response.content)
        else:
            print '\x1b[31m{}\n{}\n{}\x1b[0m'.format(
                response.status_code,
                response.headers,
                pformat(response.content),
            )
        return response

# Create OAuth2 object. It's already authenticated, thanks to the developer token.
oauth2 = OAuth2(CLIENT_ID, CLIENT_SECRET, access_token=ACCESS_TOKEN)

# Create the authenticated client
client = Client(oauth2, LoggingNetwork())