<commit_before>import cherrypy
from pockets import readable_join
from sqlalchemy import and_, or_
from sqlalchemy.orm import subqueryload

from uber.config import c
from uber.custom_tags import time_day_local
from uber.decorators import ajax, all_renderable, csv_file, log_pageview, site_mappable
from uber.errors import HTTPRedirect
from uber.models import Email, Event, Group, GuestGroup, GuestMerch, GuestTravelPlans, PageViewTracking, Tracking
from uber.utils import check, convert_to_absolute_url


@all_renderable()
class Root:
    def index(self, session, message=''):
        HTTPRedirect('../group_admin/index')

    @csv_file
    def checklist_info_csv(self, out, session):
        out.writerow([
            'Guest Type', 'Group Name', 'Primary Contact Email',
            'Payment', 'Vehicles', 'Hotel Rooms',
            'Load-In', 'Performance Time',
            'PoC Cellphone', 'Performer Count',
            'Bringing Vehicle', 'Vehicle Info',
            'Arrival Time', 'Bio',
            'Website', 'Facebook',
            'Twitter', 'Instagram', 'Twitch', 'Bandcamp', 'Discord', 'Other Social Media', 'Bio Pic', 'Bio Pic Link',
            'Wants Panel', 'Panel Name',
            'Panel Length', 'Panel Description', 'Panel Tech Needs',
            'Completed W9', 'Stage Plot',
            'Selling Merchandise',
            'Charity Answer', 'Charity Donation',
            'Travel Mode(s)', 'Travel Mode(s) Text', 'Travel Details',
        ])
        for guest in [guest for guest in session.query(GuestGroup).all() if session.admin_can_see_guest_group(guest)]:
            absolute_pic_url = convert_to_absolute_url(getattr(guest.bio, 'pic_url', ''))
            absolute_stageplot_url = convert_to_absolute_url(getattr(guest.stage_plot, 'url', ''))
            out.writerow([
                guest.group_type_label, guest.group.name, guest.email,
                guest.payment, guest.vehicles, guest.num_hotel_rooms,
                guest.estimated_loadin_minutes, guest.estimated_performance_minutes,
                getattr(guest.info, 'poc_phone', ''), getattr(guest.info, 'performer_count', ''),
                getattr(guest.info, 'bringing_vehicle', ''), getattr(guest.info, 'vehicle_info', ''),
                getattr(guest.info, 'arrival_time', ''), getattr(guest.bio, 'desc', ''),
                getattr(guest.bio, 'website', ''), getattr(guest.bio, 'facebook', ''),
                getattr(guest.bio, 'twitter', ''), getattr(guest.bio, 'instagram', ''),
                getattr(guest.bio, 'twitch', ''), getattr(guest.bio, 'bandcamp', ''),
                getattr(guest.bio, 'discord', ''), getattr(guest.bio, 'other_social_media', ''),
                getattr(guest.bio, 'pic_filename', ''), absolute_pic_url,
                getattr(guest.panel, 'wants_panel', ''), getattr(guest.panel, 'name', ''),
                getattr(guest.panel, 'length', ''), getattr(guest.panel, 'desc', ''),
                ' / '.join(getattr(guest.panel, 'panel_tech_needs_labels', '')),
                getattr(guest.taxes, 'w9_sent', ''), absolute_stageplot_url,
                getattr(guest.merch, 'selling_merch_label', ''),
                getattr(guest.charity, 'donating_label', ''), getattr(guest.charity, 'desc', ''),
                ' / '.join(getattr(guest.travel_plans, 'modes_labels', '')), getattr(guest.travel_plans, 'modes_text', ''),
                getattr(guest.travel_plans, 'details', '')
            ])

    @csv_file
    def detailed_travel_info_csv(self, out, session):
        out.writerow(['Guest Type', 'Group Name', 'Travel Mode', 'Travel Mode Text', 'Traveller', 'Companions',
                'Luggage Needs', 'Contact Email', 'Contact Phone', 'Arrival Time',
                'Arrival Details', 'Departure Time', 'Departure Details', 'Extra Details'])
        for travel_plan in session.query(GuestTravelPlans):
            for plan in travel_plan.detailed_travel_plans:
                content_row = [travel_plan.guest.group_type_label, travel_plan.guest.group.name]
                content_row.extend([plan.mode_label, plan.mode_text, plan.traveller, plan.companions,
                    plan.luggage_needs, plan.contact_email, plan.contact_phone, time_day_local(plan.arrival_time),
                    plan.arrival_details, time_day_local(plan.departure_time), plan.departure_details, plan.extra_details])
                out.writerow(content_row)
            
    @site_mappable
    def rock_island(self, session, message='', only_empty=None, id=None, **params):
        query = session.query(GuestGroup).options(
                subqueryload(GuestGroup.group)).options(
                subqueryload(GuestGroup.merch))
        if id:<commit_msg>Add "needs rehearsal" to the guest checklist export<commit_after>import cherrypy
from pockets import readable_join
from sqlalchemy import and_, or_
from sqlalchemy.orm import subqueryload

from uber.config import c
from uber.custom_tags import time_day_local
from uber.decorators import ajax, all_renderable, csv_file, log_pageview, site_mappable
from uber.errors import HTTPRedirect
from uber.models import Email, Event, Group, GuestGroup, GuestMerch, GuestTravelPlans, PageViewTracking, Tracking
from uber.utils import check, convert_to_absolute_url


@all_renderable()
class Root:
    def index(self, session, message=''):
        HTTPRedirect('../group_admin/index')

    @csv_file
    def checklist_info_csv(self, out, session):
        out.writerow([
            'Guest Type', 'Group Name', 'Primary Contact Email',
            'Payment', 'Vehicles', 'Hotel Rooms',
            'Load-In', 'Performance Time',
            'PoC Cellphone', 'Performer Count',
            'Bringing Vehicle', 'Vehicle Info',
            'Arrival Time', 'Bio',
            'Website', 'Facebook',
            'Twitter', 'Instagram', 'Twitch', 'Bandcamp', 'Discord', 'Other Social Media', 'Bio Pic', 'Bio Pic Link',
            'Wants Panel', 'Panel Name',
            'Panel Length', 'Panel Description', 'Panel Tech Needs',
            'Completed W9', 'Stage Plot',
            'Selling Merchandise',
            'Charity Answer', 'Charity Donation',
            'Travel Mode(s)', 'Travel Mode(s) Text', 'Travel Details',
            'Needs Rehearsal?',
        ])
        for guest in [guest for guest in session.query(GuestGroup).all() if session.admin_can_see_guest_group(guest)]:
            absolute_pic_url = convert_to_absolute_url(getattr(guest.bio, 'pic_url', ''))
            absolute_stageplot_url = convert_to_absolute_url(getattr(guest.stage_plot, 'url', ''))
            out.writerow([
                guest.group_type_label, guest.group.name, guest.email,
                guest.payment, guest.vehicles, guest.num_hotel_rooms,
                guest.estimated_loadin_minutes, guest.estimated_performance_minutes,
                getattr(guest.info, 'poc_phone', ''), getattr(guest.info, 'performer_count', ''),
                getattr(guest.info, 'bringing_vehicle', ''), getattr(guest.info, 'vehicle_info', ''),
                getattr(guest.info, 'arrival_time', ''), getattr(guest.bio, 'desc', ''),
                getattr(guest.bio, 'website', ''), getattr(guest.bio, 'facebook', ''),
                getattr(guest.bio, 'twitter', ''), getattr(guest.bio, 'instagram', ''),
                getattr(guest.bio, 'twitch', ''), getattr(guest.bio, 'bandcamp', ''),
                getattr(guest.bio, 'discord', ''), getattr(guest.bio, 'other_social_media', ''),
                getattr(guest.bio, 'pic_filename', ''), absolute_pic_url,
                getattr(guest.panel, 'wants_panel', ''), getattr(guest.panel, 'name', ''),
                getattr(guest.panel, 'length', ''), getattr(guest.panel, 'desc', ''),
                ' / '.join(getattr(guest.panel, 'panel_tech_needs_labels', '')),
                getattr(guest.taxes, 'w9_sent', ''), absolute_stageplot_url,
                getattr(guest.merch, 'selling_merch_label', ''),
                getattr(guest.charity, 'donating_label', ''), getattr(guest.charity, 'desc', ''),
                ' / '.join(getattr(guest.travel_plans, 'modes_labels', '')), getattr(guest.travel_plans, 'modes_text', ''),
                getattr(guest.travel_plans, 'details', ''), guest.rehearsal_status or 'N/A',
            ])

    @csv_file
    def detailed_travel_info_csv(self, out, session):
        out.writerow(['Guest Type', 'Group Name', 'Travel Mode', 'Travel Mode Text', 'Traveller', 'Companions',
                'Luggage Needs', 'Contact Email', 'Contact Phone', 'Arrival Time',
                'Arrival Details', 'Departure Time', 'Departure Details', 'Extra Details'])
        for travel_plan in session.query(GuestTravelPlans):
            for plan in travel_plan.detailed_travel_plans:
                content_row = [travel_plan.guest.group_type_label, travel_plan.guest.group.name]
                content_row.extend([plan.mode_label, plan.mode_text, plan.traveller, plan.companions,
                    plan.luggage_needs, plan.contact_email, plan.contact_phone, time_day_local(plan.arrival_time),
                    plan.arrival_details, time_day_local(plan.departure_time), plan.departure_details, plan.extra_details])
                out.writerow(content_row)
            
    @site_mappable
    def rock_island(self, session, message='', only_empty=None, id=None, **params):
        query = session.query(GuestGroup).options(
                subqueryload(GuestGroup.group)).options(
                subqueryload(GuestGroup.merch))
        if id:
{'fraction_non_alphanumeric': 0.1372342664702168, 'fraction_numerical': 0.0004209640075773521, 'mean_word_length': 2.909090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6026758', 'n_tokens_mistral': 3056, 'n_tokens_neox': 2886, 'n_words': 579}