human
I wrote the below code

    global CELL_CACHE
    if (cell_mapping is not None):
        from nova import db
        from nova import rpc
        @utils.synchronized(cell_mapping.uuid)
        def get_or_set_cached_cell_and_set_connections():
            try:
                cell_tuple = CELL_CACHE[cell_mapping.uuid]
            except KeyError:
                db_connection_string = cell_mapping.database_connection
                context.db_connection = db.create_context_manager(db_connection_string)
                if (not cell_mapping.transport_url.startswith('none')):
                    context.mq_connection = rpc.create_transport(cell_mapping.transport_url)
                CELL_CACHE[cell_mapping.uuid] = (context.db_connection, context.mq_connection)
            else:
                context.db_connection = cell_tuple[0]
                context.mq_connection = cell_tuple[1]
        get_or_set_cached_cell_and_set_connections()
    else:
        context.db_connection = None
        context.mq_connection = None

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def set_target_cell(context, cell_mapping):