def session_num_access_methods(session, access_method):
    """Number of times a given access method is associated with a pageview in session."""
    return len([r for r in session if 'referer_class' in r and r['referer_class'] == access_method])