<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_books_containing_page(cursor, uuid, version, context_uuid=None, context_version=None):
 """Return a list of book names and UUIDs that contain a given module UUID."""

    with db_connect() as db_connection:
        # Uses a RealDictCursor instead of the regular cursor
        with db_connection.cursor(
                    cursor_factory=psycopg2.extras.RealDictCursor
                ) as real_dict_cursor:
            # In the future the books-containing-page SQL might handle
            # all of these cases. For now we branch the code out in here.
            if context_uuid and context_version:
                return [get_book_info(cursor, real_dict_cursor, context_uuid,
                                      context_version, uuid, version)]
            else:
                portal_type = get_portal_type(cursor, uuid, version)
                if portal_type == 'Module':
                    real_dict_cursor.execute(SQL['get-books-containing-page'],
                                             {'document_uuid': uuid,
                                              'document_version': version})
                    return real_dict_cursor.fetchall()
                else:
                    # Books are currently not in any other book
                    return []