We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
CSV: Show time in human readable form.
Show time in human readable form  in CSV export.

Currently it is shown like this `2021-03-12 10:52:27.918251+00:00`

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `app/api/helpers/csv_jobs_util.py`
Content:
```
1 import pytz
2 
3 from app.models.helpers.versioning import strip_tags
4 
5 
6 def export_orders_csv(orders):
7     headers = [
8         'Order#',
9         'Order Date',
10         'Status',
11         'Payment Type',
12         'Payment Mode',
13         'Total Amount',
14         'Quantity',
15         'Discount Code',
16         'First Name',
17         'Last Name',
18         'Email',
19         'Tax ID',
20         'Address',
21         'Company',
22         'Country',
23         'State',
24         'City',
25         'Zipcode',
26     ]
27 
28     rows = [headers]
29     for order in orders:
30         if order.status != "deleted":
31             column = [
32                 str(order.get_invoice_number()),
33                 str(order.created_at) if order.created_at else '',
34                 str(order.status) if order.status else '',
35                 str(order.paid_via) if order.paid_via else '',
36                 str(order.payment_mode) if order.payment_mode else '',
37                 str(order.amount) if order.amount else '',
38                 str(order.tickets_count),
39                 str(order.discount_code.code) if order.discount_code else '',
40                 str(order.user.first_name)
41                 if order.user and order.user.first_name
42                 else '',
43                 str(order.user.last_name) if order.user and order.user.last_name else '',
44                 str(order.user.email) if order.user and order.user.email else '',
45                 str(order.tax_business_info) if order.tax_business_info else '',
46                 str(order.address) if order.address else '',
47                 str(order.company) if order.company else '',
48                 str(order.country) if order.country else '',
49                 str(order.state) if order.state else '',
50                 str(order.city) if order.city else '',
51                 str(order.zipcode) if order.zipcode else '',
52             ]
53             rows.append(column)
54 
55     return rows
56 
57 
58 def export_attendees_csv(attendees, custom_forms):
59 
60     headers = [
61         'Order#',
62         'Order Date',
63         'Status',
64         'Payment Type',
65         'Payment Mode',
66         'Ticket Name',
67         'Ticket Price',
68         'Ticket Type',
69         'Tax ID',
70         'Address',
71         'Company',
72         'Country',
73         'State',
74         'City',
75         'Zipcode',
76     ]
77 
78     for fields in custom_forms:
79         headers.append(fields.name)
80 
81     rows = [headers]
82     for attendee in attendees:
83         column = [
84             str(attendee.order.get_invoice_number()) if attendee.order else '-',
85             str(attendee.order.created_at)
86             if attendee.order and attendee.order.created_at
87             else '-',
88             str(attendee.order.status)
89             if attendee.order and attendee.order.status
90             else '-',
91             str(attendee.order.paid_via)
92             if attendee.order and attendee.order.paid_via
93             else '',
94             str(attendee.order.payment_mode)
95             if attendee.order and attendee.order.payment_mode
96             else '',
97             str(attendee.ticket.name) if attendee.ticket and attendee.ticket.name else '',
98             str(attendee.ticket.price)
99             if attendee.ticket and attendee.ticket.price
100             else '0',
101             str(attendee.ticket.type) if attendee.ticket and attendee.ticket.type else '',
102             str(attendee.order.tax_business_info)
103             if attendee.order.tax_business_info
104             else '',
105             str(attendee.order.address) if attendee.order.address else '',
106             str(attendee.order.company) if attendee.order.company else '',
107             str(attendee.order.country) if attendee.order.country else '',
108             str(attendee.order.state) if attendee.order.state else '',
109             str(attendee.order.city) if attendee.order.city else '',
110             str(attendee.order.zipcode) if attendee.order.zipcode else '',
111         ]
112         for field in custom_forms:
113             if field.is_complex:
114                 fields_dict = attendee.complex_field_values
115                 column.append(
116                     fields_dict.get(field.identifier, '') if fields_dict else ''
117                 )
118             else:
119                 column.append(getattr(attendee, field.identifier, ''))
120 
121         rows.append(column)
122 
123     return rows
124 
125 
126 def export_sessions_csv(sessions):
127     headers = [
128         'Session Title',
129         'Session Starts At',
130         'Session Ends At',
131         'Session Speakers',
132         'Speaker Emails',
133         'Session Track',
134         'Session Abstract Short',
135         'Session Abstract Long',
136         'Comment',
137         'Created At',
138         'Email Sent',
139         'Level',
140         'Status',
141         'Session Type',
142         'Talk Length',
143         'Language',
144         'Slides',
145         'Audio',
146         'Video',
147         'Average Rating',
148         'Number of Ratings',
149     ]
150     rows = [headers]
151     for session in sessions:
152         if not session.deleted_at:
153             column = [session.title + ' (' + session.state + ')' if session.title else '']
154             column.append(
155                 session.starts_at.astimezone(pytz.timezone(session.event.timezone))
156                 if session.starts_at
157                 else ''
158             )
159             column.append(
160                 session.ends_at.astimezone(pytz.timezone(session.event.timezone))
161                 if session.ends_at
162                 else ''
163             )
164             column.append(
165                 '; '.join(
166                     list(filter(bool, map(lambda sp: sp.name, session.speakers or [])))
167                 )
168             )
169             column.append(
170                 '; '.join(
171                     list(filter(bool, map(lambda sp: sp.email, session.speakers or [])))
172                 )
173             )
174             column.append(
175                 session.track.name if session.track and session.track.name else ''
176             )
177             column.append(
178                 strip_tags(session.short_abstract) if session.short_abstract else ''
179             )
180             column.append(
181                 strip_tags(session.long_abstract) if session.long_abstract else ''
182             )
183             column.append(strip_tags(session.comments) if session.comments else '')
184             column.append(session.created_at if session.created_at else '')
185             column.append('Yes' if session.is_mail_sent else 'No')
186             column.append(session.level)
187             column.append(session.state)
188             column.append(
189                 session.session_type.name
190                 if session.session_type and session.session_type.name
191                 else ''
192             )
193             column.append(
194                 session.session_type.length
195                 if session.session_type and session.session_type.length
196                 else ''
197             )
198             column.append(session.language if session.language else '')
199             column.append(session.slides_url if session.slides_url else '')
200             column.append(session.audio_url if session.audio_url else '')
201             column.append(session.video_url if session.video_url else '')
202             column.append(session.average_rating)
203             column.append(session.rating_count)
204             rows.append(column)
205 
206     return rows
207 
208 
209 def export_speakers_csv(speakers):
210     headers = [
211         'Speaker Name',
212         'Speaker Email',
213         'Speaker Session(s)',
214         'Speaker Mobile',
215         'Speaker Bio',
216         'Speaker Organisation',
217         'Speaker Position',
218         'Speaker Experience',
219         'Speaker Sponsorship Required',
220         'Speaker City',
221         'Speaker Country',
222         'Speaker Website',
223         'Speaker Twitter',
224         'Speaker Facebook',
225         'Speaker Github',
226         'Speaker LinkedIn',
227     ]
228     rows = [headers]
229     for speaker in speakers:
230         column = [
231             speaker.name if speaker.name else '',
232             speaker.email if speaker.email else '',
233         ]
234         if speaker.sessions:
235             session_details = ''
236             for session in speaker.sessions:
237                 if not session.deleted_at:
238                     session_details += session.title + ' (' + session.state + '); '
239             column.append(session_details[:-2])
240         else:
241             column.append('')
242         column.append(speaker.mobile if speaker.mobile else '')
243         column.append(speaker.short_biography if speaker.short_biography else '')
244         column.append(speaker.organisation if speaker.organisation else '')
245         column.append(speaker.position if speaker.position else '')
246         column.append(speaker.speaking_experience if speaker.speaking_experience else '')
247         column.append(
248             speaker.sponsorship_required if speaker.sponsorship_required else ''
249         )
250         column.append(speaker.city if speaker.city else '')
251         column.append(speaker.country if speaker.country else '')
252         column.append(speaker.website if speaker.website else '')
253         column.append(speaker.twitter if speaker.twitter else '')
254         column.append(speaker.facebook if speaker.facebook else '')
255         column.append(speaker.github if speaker.github else '')
256         column.append(speaker.linkedin if speaker.linkedin else '')
257         rows.append(column)
258 
259     return rows
260
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/app/api/helpers/csv_jobs_util.py b/app/api/helpers/csv_jobs_util.py
--- a/app/api/helpers/csv_jobs_util.py
+++ b/app/api/helpers/csv_jobs_util.py
@@ -82,7 +82,7 @@
     for attendee in attendees:
         column = [
             str(attendee.order.get_invoice_number()) if attendee.order else '-',
-            str(attendee.order.created_at)
+            str(attendee.order.created_at.strftime('%B %-d, %Y %H:%M %z'))
             if attendee.order and attendee.order.created_at
             else '-',
             str(attendee.order.status)
@@ -152,12 +152,16 @@
         if not session.deleted_at:
             column = [session.title + ' (' + session.state + ')' if session.title else '']
             column.append(
-                session.starts_at.astimezone(pytz.timezone(session.event.timezone))
+                session.starts_at.astimezone(
+                    pytz.timezone(session.event.timezone)
+                ).strftime('%B %-d, %Y %H:%M %z')
                 if session.starts_at
                 else ''
             )
             column.append(
-                session.ends_at.astimezone(pytz.timezone(session.event.timezone))
+                session.ends_at.astimezone(
+                    pytz.timezone(session.event.timezone)
+                ).strftime('%B %-d, %Y %H:%M %z')
                 if session.ends_at
                 else ''
             )
@@ -181,7 +185,11 @@
                 strip_tags(session.long_abstract) if session.long_abstract else ''
             )
             column.append(strip_tags(session.comments) if session.comments else '')
-            column.append(session.created_at if session.created_at else '')
+            column.append(
+                session.created_at.strftime('%B %-d, %Y %H:%M %z')
+                if session.created_at
+                else ''
+            )
             column.append('Yes' if session.is_mail_sent else 'No')
             column.append(session.level)
             column.append(session.state)

{"golden_diff": "diff --git a/app/api/helpers/csv_jobs_util.py b/app/api/helpers/csv_jobs_util.py\n--- a/app/api/helpers/csv_jobs_util.py\n+++ b/app/api/helpers/csv_jobs_util.py\n@@ -82,7 +82,7 @@\n     for attendee in attendees:\n         column = [\n             str(attendee.order.get_invoice_number()) if attendee.order else '-',\n-            str(attendee.order.created_at)\n+            str(attendee.order.created_at.strftime('%B %-d, %Y %H:%M %z'))\n             if attendee.order and attendee.order.created_at\n             else '-',\n             str(attendee.order.status)\n@@ -152,12 +152,16 @@\n         if not session.deleted_at:\n             column = [session.title + ' (' + session.state + ')' if session.title else '']\n             column.append(\n-                session.starts_at.astimezone(pytz.timezone(session.event.timezone))\n+                session.starts_at.astimezone(\n+                    pytz.timezone(session.event.timezone)\n+                ).strftime('%B %-d, %Y %H:%M %z')\n                 if session.starts_at\n                 else ''\n             )\n             column.append(\n-                session.ends_at.astimezone(pytz.timezone(session.event.timezone))\n+                session.ends_at.astimezone(\n+                    pytz.timezone(session.event.timezone)\n+                ).strftime('%B %-d, %Y %H:%M %z')\n                 if session.ends_at\n                 else ''\n             )\n@@ -181,7 +185,11 @@\n                 strip_tags(session.long_abstract) if session.long_abstract else ''\n             )\n             column.append(strip_tags(session.comments) if session.comments else '')\n-            column.append(session.created_at if session.created_at else '')\n+            column.append(\n+                session.created_at.strftime('%B %-d, %Y %H:%M %z')\n+                if session.created_at\n+                else ''\n+            )\n             column.append('Yes' if session.is_mail_sent else 'No')\n             column.append(session.level)\n             column.append(session.state)\n", "issue": "CSV: Show time in human readable form.\nShow time in human readable form  in CSV export.\r\n\r\nCurrently it is shown like this `2021-03-12 10:52:27.918251+00:00`\n", "before_files": [{"content": "import pytz\n\nfrom app.models.helpers.versioning import strip_tags\n\n\ndef export_orders_csv(orders):\n    headers = [\n        'Order#',\n        'Order Date',\n        'Status',\n        'Payment Type',\n        'Payment Mode',\n        'Total Amount',\n        'Quantity',\n        'Discount Code',\n        'First Name',\n        'Last Name',\n        'Email',\n        'Tax ID',\n        'Address',\n        'Company',\n        'Country',\n        'State',\n        'City',\n        'Zipcode',\n    ]\n\n    rows = [headers]\n    for order in orders:\n        if order.status != \"deleted\":\n            column = [\n                str(order.get_invoice_number()),\n                str(order.created_at) if order.created_at else '',\n                str(order.status) if order.status else '',\n                str(order.paid_via) if order.paid_via else '',\n                str(order.payment_mode) if order.payment_mode else '',\n                str(order.amount) if order.amount else '',\n                str(order.tickets_count),\n                str(order.discount_code.code) if order.discount_code else '',\n                str(order.user.first_name)\n                if order.user and order.user.first_name\n                else '',\n                str(order.user.last_name) if order.user and order.user.last_name else '',\n                str(order.user.email) if order.user and order.user.email else '',\n                str(order.tax_business_info) if order.tax_business_info else '',\n                str(order.address) if order.address else '',\n                str(order.company) if order.company else '',\n                str(order.country) if order.country else '',\n                str(order.state) if order.state else '',\n                str(order.city) if order.city else '',\n                str(order.zipcode) if order.zipcode else '',\n            ]\n            rows.append(column)\n\n    return rows\n\n\ndef export_attendees_csv(attendees, custom_forms):\n\n    headers = [\n        'Order#',\n        'Order Date',\n        'Status',\n        'Payment Type',\n        'Payment Mode',\n        'Ticket Name',\n        'Ticket Price',\n        'Ticket Type',\n        'Tax ID',\n        'Address',\n        'Company',\n        'Country',\n        'State',\n        'City',\n        'Zipcode',\n    ]\n\n    for fields in custom_forms:\n        headers.append(fields.name)\n\n    rows = [headers]\n    for attendee in attendees:\n        column = [\n            str(attendee.order.get_invoice_number()) if attendee.order else '-',\n            str(attendee.order.created_at)\n            if attendee.order and attendee.order.created_at\n            else '-',\n            str(attendee.order.status)\n            if attendee.order and attendee.order.status\n            else '-',\n            str(attendee.order.paid_via)\n            if attendee.order and attendee.order.paid_via\n            else '',\n            str(attendee.order.payment_mode)\n            if attendee.order and attendee.order.payment_mode\n            else '',\n            str(attendee.ticket.name) if attendee.ticket and attendee.ticket.name else '',\n            str(attendee.ticket.price)\n            if attendee.ticket and attendee.ticket.price\n            else '0',\n            str(attendee.ticket.type) if attendee.ticket and attendee.ticket.type else '',\n            str(attendee.order.tax_business_info)\n            if attendee.order.tax_business_info\n            else '',\n            str(attendee.order.address) if attendee.order.address else '',\n            str(attendee.order.company) if attendee.order.company else '',\n            str(attendee.order.country) if attendee.order.country else '',\n            str(attendee.order.state) if attendee.order.state else '',\n            str(attendee.order.city) if attendee.order.city else '',\n            str(attendee.order.zipcode) if attendee.order.zipcode else '',\n        ]\n        for field in custom_forms:\n            if field.is_complex:\n                fields_dict = attendee.complex_field_values\n                column.append(\n                    fields_dict.get(field.identifier, '') if fields_dict else ''\n                )\n            else:\n                column.append(getattr(attendee, field.identifier, ''))\n\n        rows.append(column)\n\n    return rows\n\n\ndef export_sessions_csv(sessions):\n    headers = [\n        'Session Title',\n        'Session Starts At',\n        'Session Ends At',\n        'Session Speakers',\n        'Speaker Emails',\n        'Session Track',\n        'Session Abstract Short',\n        'Session Abstract Long',\n        'Comment',\n        'Created At',\n        'Email Sent',\n        'Level',\n        'Status',\n        'Session Type',\n        'Talk Length',\n        'Language',\n        'Slides',\n        'Audio',\n        'Video',\n        'Average Rating',\n        'Number of Ratings',\n    ]\n    rows = [headers]\n    for session in sessions:\n        if not session.deleted_at:\n            column = [session.title + ' (' + session.state + ')' if session.title else '']\n            column.append(\n                session.starts_at.astimezone(pytz.timezone(session.event.timezone))\n                if session.starts_at\n                else ''\n            )\n            column.append(\n                session.ends_at.astimezone(pytz.timezone(session.event.timezone))\n                if session.ends_at\n                else ''\n            )\n            column.append(\n                '; '.join(\n                    list(filter(bool, map(lambda sp: sp.name, session.speakers or [])))\n                )\n            )\n            column.append(\n                '; '.join(\n                    list(filter(bool, map(lambda sp: sp.email, session.speakers or [])))\n                )\n            )\n            column.append(\n                session.track.name if session.track and session.track.name else ''\n            )\n            column.append(\n                strip_tags(session.short_abstract) if session.short_abstract else ''\n            )\n            column.append(\n                strip_tags(session.long_abstract) if session.long_abstract else ''\n            )\n            column.append(strip_tags(session.comments) if session.comments else '')\n            column.append(session.created_at if session.created_at else '')\n            column.append('Yes' if session.is_mail_sent else 'No')\n            column.append(session.level)\n            column.append(session.state)\n            column.append(\n                session.session_type.name\n                if session.session_type and session.session_type.name\n                else ''\n            )\n            column.append(\n                session.session_type.length\n                if session.session_type and session.session_type.length\n                else ''\n            )\n            column.append(session.language if session.language else '')\n            column.append(session.slides_url if session.slides_url else '')\n            column.append(session.audio_url if session.audio_url else '')\n            column.append(session.video_url if session.video_url else '')\n            column.append(session.average_rating)\n            column.append(session.rating_count)\n            rows.append(column)\n\n    return rows\n\n\ndef export_speakers_csv(speakers):\n    headers = [\n        'Speaker Name',\n        'Speaker Email',\n        'Speaker Session(s)',\n        'Speaker Mobile',\n        'Speaker Bio',\n        'Speaker Organisation',\n        'Speaker Position',\n        'Speaker Experience',\n        'Speaker Sponsorship Required',\n        'Speaker City',\n        'Speaker Country',\n        'Speaker Website',\n        'Speaker Twitter',\n        'Speaker Facebook',\n        'Speaker Github',\n        'Speaker LinkedIn',\n    ]\n    rows = [headers]\n    for speaker in speakers:\n        column = [\n            speaker.name if speaker.name else '',\n            speaker.email if speaker.email else '',\n        ]\n        if speaker.sessions:\n            session_details = ''\n            for session in speaker.sessions:\n                if not session.deleted_at:\n                    session_details += session.title + ' (' + session.state + '); '\n            column.append(session_details[:-2])\n        else:\n            column.append('')\n        column.append(speaker.mobile if speaker.mobile else '')\n        column.append(speaker.short_biography if speaker.short_biography else '')\n        column.append(speaker.organisation if speaker.organisation else '')\n        column.append(speaker.position if speaker.position else '')\n        column.append(speaker.speaking_experience if speaker.speaking_experience else '')\n        column.append(\n            speaker.sponsorship_required if speaker.sponsorship_required else ''\n        )\n        column.append(speaker.city if speaker.city else '')\n        column.append(speaker.country if speaker.country else '')\n        column.append(speaker.website if speaker.website else '')\n        column.append(speaker.twitter if speaker.twitter else '')\n        column.append(speaker.facebook if speaker.facebook else '')\n        column.append(speaker.github if speaker.github else '')\n        column.append(speaker.linkedin if speaker.linkedin else '')\n        rows.append(column)\n\n    return rows\n", "path": "app/api/helpers/csv_jobs_util.py"}], "after_files": [{"content": "import pytz\n\nfrom app.models.helpers.versioning import strip_tags\n\n\ndef export_orders_csv(orders):\n    headers = [\n        'Order#',\n        'Order Date',\n        'Status',\n        'Payment Type',\n        'Payment Mode',\n        'Total Amount',\n        'Quantity',\n        'Discount Code',\n        'First Name',\n        'Last Name',\n        'Email',\n        'Tax ID',\n        'Address',\n        'Company',\n        'Country',\n        'State',\n        'City',\n        'Zipcode',\n    ]\n\n    rows = [headers]\n    for order in orders:\n        if order.status != \"deleted\":\n            column = [\n                str(order.get_invoice_number()),\n                str(order.created_at) if order.created_at else '',\n                str(order.status) if order.status else '',\n                str(order.paid_via) if order.paid_via else '',\n                str(order.payment_mode) if order.payment_mode else '',\n                str(order.amount) if order.amount else '',\n                str(order.tickets_count),\n                str(order.discount_code.code) if order.discount_code else '',\n                str(order.user.first_name)\n                if order.user and order.user.first_name\n                else '',\n                str(order.user.last_name) if order.user and order.user.last_name else '',\n                str(order.user.email) if order.user and order.user.email else '',\n                str(order.tax_business_info) if order.tax_business_info else '',\n                str(order.address) if order.address else '',\n                str(order.company) if order.company else '',\n                str(order.country) if order.country else '',\n                str(order.state) if order.state else '',\n                str(order.city) if order.city else '',\n                str(order.zipcode) if order.zipcode else '',\n            ]\n            rows.append(column)\n\n    return rows\n\n\ndef export_attendees_csv(attendees, custom_forms):\n\n    headers = [\n        'Order#',\n        'Order Date',\n        'Status',\n        'Payment Type',\n        'Payment Mode',\n        'Ticket Name',\n        'Ticket Price',\n        'Ticket Type',\n        'Tax ID',\n        'Address',\n        'Company',\n        'Country',\n        'State',\n        'City',\n        'Zipcode',\n    ]\n\n    for fields in custom_forms:\n        headers.append(fields.name)\n\n    rows = [headers]\n    for attendee in attendees:\n        column = [\n            str(attendee.order.get_invoice_number()) if attendee.order else '-',\n            str(attendee.order.created_at.strftime('%B %-d, %Y %H:%M %z'))\n            if attendee.order and attendee.order.created_at\n            else '-',\n            str(attendee.order.status)\n            if attendee.order and attendee.order.status\n            else '-',\n            str(attendee.order.paid_via)\n            if attendee.order and attendee.order.paid_via\n            else '',\n            str(attendee.order.payment_mode)\n            if attendee.order and attendee.order.payment_mode\n            else '',\n            str(attendee.ticket.name) if attendee.ticket and attendee.ticket.name else '',\n            str(attendee.ticket.price)\n            if attendee.ticket and attendee.ticket.price\n            else '0',\n            str(attendee.ticket.type) if attendee.ticket and attendee.ticket.type else '',\n            str(attendee.order.tax_business_info)\n            if attendee.order.tax_business_info\n            else '',\n            str(attendee.order.address) if attendee.order.address else '',\n            str(attendee.order.company) if attendee.order.company else '',\n            str(attendee.order.country) if attendee.order.country else '',\n            str(attendee.order.state) if attendee.order.state else '',\n            str(attendee.order.city) if attendee.order.city else '',\n            str(attendee.order.zipcode) if attendee.order.zipcode else '',\n        ]\n        for field in custom_forms:\n            if field.is_complex:\n                fields_dict = attendee.complex_field_values\n                column.append(\n                    fields_dict.get(field.identifier, '') if fields_dict else ''\n                )\n            else:\n                column.append(getattr(attendee, field.identifier, ''))\n\n        rows.append(column)\n\n    return rows\n\n\ndef export_sessions_csv(sessions):\n    headers = [\n        'Session Title',\n        'Session Starts At',\n        'Session Ends At',\n        'Session Speakers',\n        'Speaker Emails',\n        'Session Track',\n        'Session Abstract Short',\n        'Session Abstract Long',\n        'Comment',\n        'Created At',\n        'Email Sent',\n        'Level',\n        'Status',\n        'Session Type',\n        'Talk Length',\n        'Language',\n        'Slides',\n        'Audio',\n        'Video',\n        'Average Rating',\n        'Number of Ratings',\n    ]\n    rows = [headers]\n    for session in sessions:\n        if not session.deleted_at:\n            column = [session.title + ' (' + session.state + ')' if session.title else '']\n            column.append(\n                session.starts_at.astimezone(\n                    pytz.timezone(session.event.timezone)\n                ).strftime('%B %-d, %Y %H:%M %z')\n                if session.starts_at\n                else ''\n            )\n            column.append(\n                session.ends_at.astimezone(\n                    pytz.timezone(session.event.timezone)\n                ).strftime('%B %-d, %Y %H:%M %z')\n                if session.ends_at\n                else ''\n            )\n            column.append(\n                '; '.join(\n                    list(filter(bool, map(lambda sp: sp.name, session.speakers or [])))\n                )\n            )\n            column.append(\n                '; '.join(\n                    list(filter(bool, map(lambda sp: sp.email, session.speakers or [])))\n                )\n            )\n            column.append(\n                session.track.name if session.track and session.track.name else ''\n            )\n            column.append(\n                strip_tags(session.short_abstract) if session.short_abstract else ''\n            )\n            column.append(\n                strip_tags(session.long_abstract) if session.long_abstract else ''\n            )\n            column.append(strip_tags(session.comments) if session.comments else '')\n            column.append(\n                session.created_at.strftime('%B %-d, %Y %H:%M %z')\n                if session.created_at\n                else ''\n            )\n            column.append('Yes' if session.is_mail_sent else 'No')\n            column.append(session.level)\n            column.append(session.state)\n            column.append(\n                session.session_type.name\n                if session.session_type and session.session_type.name\n                else ''\n            )\n            column.append(\n                session.session_type.length\n                if session.session_type and session.session_type.length\n                else ''\n            )\n            column.append(session.language if session.language else '')\n            column.append(session.slides_url if session.slides_url else '')\n            column.append(session.audio_url if session.audio_url else '')\n            column.append(session.video_url if session.video_url else '')\n            column.append(session.average_rating)\n            column.append(session.rating_count)\n            rows.append(column)\n\n    return rows\n\n\ndef export_speakers_csv(speakers):\n    headers = [\n        'Speaker Name',\n        'Speaker Email',\n        'Speaker Session(s)',\n        'Speaker Mobile',\n        'Speaker Bio',\n        'Speaker Organisation',\n        'Speaker Position',\n        'Speaker Experience',\n        'Speaker Sponsorship Required',\n        'Speaker City',\n        'Speaker Country',\n        'Speaker Website',\n        'Speaker Twitter',\n        'Speaker Facebook',\n        'Speaker Github',\n        'Speaker LinkedIn',\n    ]\n    rows = [headers]\n    for speaker in speakers:\n        column = [\n            speaker.name if speaker.name else '',\n            speaker.email if speaker.email else '',\n        ]\n        if speaker.sessions:\n            session_details = ''\n            for session in speaker.sessions:\n                if not session.deleted_at:\n                    session_details += session.title + ' (' + session.state + '); '\n            column.append(session_details[:-2])\n        else:\n            column.append('')\n        column.append(speaker.mobile if speaker.mobile else '')\n        column.append(speaker.short_biography if speaker.short_biography else '')\n        column.append(speaker.organisation if speaker.organisation else '')\n        column.append(speaker.position if speaker.position else '')\n        column.append(speaker.speaking_experience if speaker.speaking_experience else '')\n        column.append(\n            speaker.sponsorship_required if speaker.sponsorship_required else ''\n        )\n        column.append(speaker.city if speaker.city else '')\n        column.append(speaker.country if speaker.country else '')\n        column.append(speaker.website if speaker.website else '')\n        column.append(speaker.twitter if speaker.twitter else '')\n        column.append(speaker.facebook if speaker.facebook else '')\n        column.append(speaker.github if speaker.github else '')\n        column.append(speaker.linkedin if speaker.linkedin else '')\n        rows.append(column)\n\n    return rows\n", "path": "app/api/helpers/csv_jobs_util.py"}]}