content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Python - 3.6.0 def tickets(people): moneys = {k: 0 for k in [25, 50, 100]} for cost in people: if cost == 50: if moneys[25] < 1: return 'NO' moneys[25] -= 1 elif cost == 100: if moneys[50] >= 1: if moneys[25] < 1: return 'NO' moneys[50] -= 1 moneys[25] -= 1 else: if moneys[25] < 3: return 'NO' moneys[25] -= 3 moneys[cost] += 1 return 'YES'
def tickets(people): moneys = {k: 0 for k in [25, 50, 100]} for cost in people: if cost == 50: if moneys[25] < 1: return 'NO' moneys[25] -= 1 elif cost == 100: if moneys[50] >= 1: if moneys[25] < 1: return 'NO' moneys[50] -= 1 moneys[25] -= 1 else: if moneys[25] < 3: return 'NO' moneys[25] -= 3 moneys[cost] += 1 return 'YES'
LANGS = ["hi,my,fa,tk,vi,zh,ka,zh_yue,hy,ru", "hi,my,fa,vi,zh,tk,zh_yue,ru,bxr,cdo", "hi,my,fa,vi,tk,jv,zh_yue,id,zh,am", "is,en,se,et,fi,fr,kv,cs,de,eu", "et,lv,fi,en,se,cs,de,fr,is,hu", "cs,en,de,fr,lv,et,hu,fi,la,eu", "lv,et,cs,hu,de,el,fi,myv,mhr,tr", "hu,el,cs,de,lv,tr,la,et,xmf,myv", "el,hu,tr,la,cs,de,xmf,lv,hy,ka"] my_str = '' counter = 0 for langs in LANGS: print(counter) counter += 1 assert len(langs.split(',')) == 10 adapter_names = [f'{lang}/wiki@ukp' for lang in langs.split(',')] adapter_names = ','.join(adapter_names) if len(my_str) == 0: my_str = f'"{adapter_names}"' else: my_str = my_str + f' "{adapter_names}"' print(my_str)
langs = ['hi,my,fa,tk,vi,zh,ka,zh_yue,hy,ru', 'hi,my,fa,vi,zh,tk,zh_yue,ru,bxr,cdo', 'hi,my,fa,vi,tk,jv,zh_yue,id,zh,am', 'is,en,se,et,fi,fr,kv,cs,de,eu', 'et,lv,fi,en,se,cs,de,fr,is,hu', 'cs,en,de,fr,lv,et,hu,fi,la,eu', 'lv,et,cs,hu,de,el,fi,myv,mhr,tr', 'hu,el,cs,de,lv,tr,la,et,xmf,myv', 'el,hu,tr,la,cs,de,xmf,lv,hy,ka'] my_str = '' counter = 0 for langs in LANGS: print(counter) counter += 1 assert len(langs.split(',')) == 10 adapter_names = [f'{lang}/wiki@ukp' for lang in langs.split(',')] adapter_names = ','.join(adapter_names) if len(my_str) == 0: my_str = f'"{adapter_names}"' else: my_str = my_str + f' "{adapter_names}"' print(my_str)
a = [-11, -2, -4, -10, -9, 4, -5, -18, -16, 5, -6, -19, 0, -7, 11, -17, 11, 9, -7, -11, 19, -16, -11, -4, 19, -6, -6, -15, 1, 11, -1, -16, 12, 0, -15, -13, 11, -19, -15, -18, -20, 7, -8, 17, -4, 16, 6, -5, -3, -8, 17, -2, 2, 1, -2, 19, -6, 13, -7, -8, 9, -13, 4, -19, -4, 20, 20, -10, 9, 13, 18, 15, -15, -16, 20, 15, 19, -13, 6, 17, -9, -6, -3, -1, 19, 5, 2, -14, -20, 15, 20, -7, -13, 16, -16, 16, -4, 1, -20, -11] k = [] for i in range(len(a) - 1): for j in range(i + 1, len(a)): s = a[i] + a[j] if s == 7: k.append((a[i], a[j])) k1 = list(set(k)) print(len(k1)) print(k1) q = 0 for i in range(len(k1) - 1): for j in range(i + 1, len(k1)): if k1[i][0] == k1[j][1]: q += 1 print(k1[i], k1[j]) print(q)
a = [-11, -2, -4, -10, -9, 4, -5, -18, -16, 5, -6, -19, 0, -7, 11, -17, 11, 9, -7, -11, 19, -16, -11, -4, 19, -6, -6, -15, 1, 11, -1, -16, 12, 0, -15, -13, 11, -19, -15, -18, -20, 7, -8, 17, -4, 16, 6, -5, -3, -8, 17, -2, 2, 1, -2, 19, -6, 13, -7, -8, 9, -13, 4, -19, -4, 20, 20, -10, 9, 13, 18, 15, -15, -16, 20, 15, 19, -13, 6, 17, -9, -6, -3, -1, 19, 5, 2, -14, -20, 15, 20, -7, -13, 16, -16, 16, -4, 1, -20, -11] k = [] for i in range(len(a) - 1): for j in range(i + 1, len(a)): s = a[i] + a[j] if s == 7: k.append((a[i], a[j])) k1 = list(set(k)) print(len(k1)) print(k1) q = 0 for i in range(len(k1) - 1): for j in range(i + 1, len(k1)): if k1[i][0] == k1[j][1]: q += 1 print(k1[i], k1[j]) print(q)
BASE_STATS = { 1: { "Monster": {"HP": 7, "Attack": 5, "Defence": 5, "Scaling": 0.05}, "Player": {"HP": 5, "Attack": 2, "Defence": 2}, }, 30: { "Monster": {"HP": 15, "Attack": 10, "Defence": 10, "Scaling": 0.1}, "Player": {"HP": 9, "Attack": 6, "Defence": 5}, }, 60: { "Monster": {"HP": 37, "Attack": 20, "Defence": 20, "Scaling": 0.2}, "Player": {"HP": 13, "Attack": 10, "Defence": 8}, }, 90: { "Monster": {"HP": 103, "Attack": 40, "Defence": 40, "Scaling": 0.4}, "Player": {"HP": 17, "Attack": 14, "Defence": 11}, }, } LEVELS = [1, 30, 60, 90]
base_stats = {1: {'Monster': {'HP': 7, 'Attack': 5, 'Defence': 5, 'Scaling': 0.05}, 'Player': {'HP': 5, 'Attack': 2, 'Defence': 2}}, 30: {'Monster': {'HP': 15, 'Attack': 10, 'Defence': 10, 'Scaling': 0.1}, 'Player': {'HP': 9, 'Attack': 6, 'Defence': 5}}, 60: {'Monster': {'HP': 37, 'Attack': 20, 'Defence': 20, 'Scaling': 0.2}, 'Player': {'HP': 13, 'Attack': 10, 'Defence': 8}}, 90: {'Monster': {'HP': 103, 'Attack': 40, 'Defence': 40, 'Scaling': 0.4}, 'Player': {'HP': 17, 'Attack': 14, 'Defence': 11}}} levels = [1, 30, 60, 90]
# Sum vs XOR # https://www.hackerrank.com/challenges/sum-vs-xor/problem def sumXor(n): if n == 0: return 1 return 1 << f'{n:b}'.count('0') n = int(input().strip()) result = sumXor(n) print (result)
def sum_xor(n): if n == 0: return 1 return 1 << f'{n:b}'.count('0') n = int(input().strip()) result = sum_xor(n) print(result)
################################################################## # Mocked returns for patched functions that access web resources # ################################################################## GET_POLICE_STATION_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "FACILITYID": "Facility Identifier", "NAME": "Name of Facility", "OWNER": "Owner Name", "OWNTYPE": "Owner Type", "SUBTYPEFIELD": "Subtype Field", "FEATURECODE": "Feature Code", "FULLADDR": "Full Address", "AGENCYURL": "Website", "OPERDAYS": "Operational Days", "OPERHOURS": "Operational Hours", "CONTACT": "Contact Name", "PHONE": "Phone", "EMAIL": "Email" }, "features": [ { "attributes": { "OBJECTID": 1, "FACILITYID": None, "NAME": "Brookline Public Safety HQ", "OWNER": "Town of Brookline", "OWNTYPE": None, "SUBTYPEFIELD": None, "FEATURECODE": None, "FULLADDR": "350 Washington St, Brookline, MA 02445", "AGENCYURL": "http://www.brooklinepolice.com/", "OPERDAYS": "Other", "OPERHOURS": "Other", "CONTACT": None, "PHONE": "617-730-2222", "EMAIL": None }, "geometry": { "x": -71.121409303637222, "y": 42.333789044263746 } } ] } NO_RESULTS_GET_POLICE_STATION_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "FACILITYID": "Facility Identifier", "NAME": "Name of Facility", "OWNER": "Owner Name", "OWNTYPE": "Owner Type", "SUBTYPEFIELD": "Subtype Field", "FEATURECODE": "Feature Code", "FULLADDR": "Full Address", "AGENCYURL": "Website", "OPERDAYS": "Operational Days", "OPERHOURS": "Operational Hours", "CONTACT": "Contact Name", "PHONE": "Phone", "EMAIL": "Email" }, "features": [] } GEOCODE_MOCK = { "spatialReference": { "wkid": 4326, "latestWkid": 4326 }, "x": -71.120614336337198, "y": 42.334020535512529, "z": 0 } LOCATION_MOCK = { "x": -71.120614336337198, "y": 42.334020535512529, "z": 0 } SPACIAL_REFERENCE_MOCK = { "wkid": 4326, "latestWkid": 4326 } ADDRESS_CANDIDATE_MOCK = { "address": "333 WASHINGTON ST", "location": { "x": -71.120614336337198, "y": 42.334020535512529, "z": 0 }, "score": 100, "attributes": { "Loc_name": "Building", "Score": 100, "Match_addr": "333 WASHINGTON ST" } } GET_ADDRESS_CANDIDATES_API_MOCK = { "spatialReference": { "wkid": 4326, "latestWkid": 4326 }, "candidates": [ { "address": "333 WASHINGTON ST", "location": { "x": -71.120614336337198, "y": 42.334020535512529, "z": 0 }, "score": 100, "attributes": { "Loc_name": "Building", "Score": 100, "Match_addr": "333 WASHINGTON ST" } } ] } GEOCODE_ADDRESS_MOCK = { 'geometry':{'x':-7917110.640673582,'y':5211147.471469648}} GET_TRASH_PICKUP_API_MOCK = { "displayFieldName": "DISTRICTID", "fieldAliases": { "OBJECTID": "OBJECTID", "DISTRICTID": "District ID", "NAME": "District Name", "AGENCY": "Agency", "AGENCYURL": "Website", "CONTACT": "Contact Name", "PHONE": "Phone", "EMAIL": "Email", "SUBTYPEFIELD": "Subtype Field", "SCHEDULE": "Schedule", "DESCRIPT": "Additional Information", "MONDAY": "Monday", "TUESDAY": "Tuesday", "WEDNESDAY": "Wednesday", "THURSDAY": "Thursday", "FRIDAY": "Friday", "SATURDAY": "Saturday", "SUNDAY": "Sunday", "GlobalID": "GlobalID" }, "features": [ { "attributes": { "OBJECTID": 2, "DISTRICTID": "1", "NAME": "Wednesday Trash", "AGENCY": "Town of Brookline", "AGENCYURL": "http://ma-brookline.civicplus.com/820/Trash-Recycling-Information", "CONTACT": "Brookline Public Works", "PHONE": "null", "EMAIL": "null", "SUBTYPEFIELD": 0, "SCHEDULE": "Weekly", "DESCRIPT": "http://ma-brookline.civicplus.com/834/Holiday-Schedule-Christmas-Tree-Pick-Up", "MONDAY": "No", "TUESDAY": "No", "WEDNESDAY": "Yes", "THURSDAY": "No", "FRIDAY": "No", "SATURDAY": "No", "SUNDAY": "No", "GlobalID": "{20538BBF-EB83-4CCD-B1E8-93EF36554413}" }, "geometry": { "x": -71.121409303637222, "y": 42.333789044263746 } } ] } NO_RESPONSE_TRASH_PICKUP_API_MOCK = { "displayFieldName": "DISTRICTID", "fieldAliases": { "OBJECTID": "OBJECTID", "DISTRICTID": "District ID", "NAME": "District Name", "AGENCY": "Agency", "AGENCYURL": "Website", "CONTACT": "Contact Name", "PHONE": "Phone", "EMAIL": "Email", "SUBTYPEFIELD": "Subtype Field", "SCHEDULE": "Schedule", "DESCRIPT": "Additional Information", "MONDAY": "Monday", "TUESDAY": "Tuesday", "WEDNESDAY": "Wednesday", "THURSDAY": "Thursday", "FRIDAY": "Friday", "SATURDAY": "Saturday", "SUNDAY": "Sunday", "GlobalID": "GlobalID" }, "features": [] } NO_RESPONSE_VOTING_PRECINCT_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "PRECINCTID": "Precinct ID", "NAME": "Precinct Name", "COUNTY": "County", "LASTUPDATE": "Last Update Date", "LASTEDITOR": "Last Editor", "SHAPE_Length": "SHAPE_Length", "SHAPE_Area": "SHAPE_Area", "STR_NUM": "STR_NUM", "STREET": "STREET", "ADDRESS": "ADDRESS", "LOC_DESC": "LOC_DESC" }, "geometryType": "esriGeometryPolygon", "spatialReference": { "wkid": 102100, "latestWkid": 3857 }, "fields": [ { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" }, { "name": "PRECINCTID", "type": "esriFieldTypeString", "alias": "Precinct ID", "length": 10 }, { "name": "NAME", "type": "esriFieldTypeString", "alias": "Precinct Name", "length": 50 }, { "name": "COUNTY", "type": "esriFieldTypeString", "alias": "County", "length": 50 }, { "name": "LASTUPDATE", "type": "esriFieldTypeDate", "alias": "Last Update Date", "length": 8 }, { "name": "LASTEDITOR", "type": "esriFieldTypeString", "alias": "Last Editor", "length": 50 }, { "name": "SHAPE_Length", "type": "esriFieldTypeDouble", "alias": "SHAPE_Length" }, { "name": "SHAPE_Area", "type": "esriFieldTypeDouble", "alias": "SHAPE_Area" }, { "name": "STR_NUM", "type": "esriFieldTypeString", "alias": "STR_NUM", "length": 8 }, { "name": "STREET", "type": "esriFieldTypeString", "alias": "STREET", "length": 32 }, { "name": "ADDRESS", "type": "esriFieldTypeString", "alias": "ADDRESS", "length": 64 }, { "name": "LOC_DESC", "type": "esriFieldTypeString", "alias": "LOC_DESC", "length": 128 } ], "features": [ ] } GET_VOTING_PRECINCT_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "PRECINCTID": "Precinct ID", "NAME": "Precinct Name", "COUNTY": "County", "LASTUPDATE": "Last Update Date", "LASTEDITOR": "Last Editor", "SHAPE_Length": "SHAPE_Length", "SHAPE_Area": "SHAPE_Area", "STR_NUM": "STR_NUM", "STREET": "STREET", "ADDRESS": "ADDRESS", "LOC_DESC": "LOC_DESC" }, "geometryType": "esriGeometryPolygon", "spatialReference": { "wkid": 102100, "latestWkid": 3857 }, "fields": [ { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" }, { "name": "PRECINCTID", "type": "esriFieldTypeString", "alias": "Precinct ID", "length": 10 }, { "name": "NAME", "type": "esriFieldTypeString", "alias": "Precinct Name", "length": 50 }, { "name": "COUNTY", "type": "esriFieldTypeString", "alias": "County", "length": 50 }, { "name": "LASTUPDATE", "type": "esriFieldTypeDate", "alias": "Last Update Date", "length": 8 }, { "name": "LASTEDITOR", "type": "esriFieldTypeString", "alias": "Last Editor", "length": 50 }, { "name": "SHAPE_Length", "type": "esriFieldTypeDouble", "alias": "SHAPE_Length" }, { "name": "SHAPE_Area", "type": "esriFieldTypeDouble", "alias": "SHAPE_Area" }, { "name": "STR_NUM", "type": "esriFieldTypeString", "alias": "STR_NUM", "length": 8 }, { "name": "STREET", "type": "esriFieldTypeString", "alias": "STREET", "length": 32 }, { "name": "ADDRESS", "type": "esriFieldTypeString", "alias": "ADDRESS", "length": 64 }, { "name": "LOC_DESC", "type": "esriFieldTypeString", "alias": "LOC_DESC", "length": 128 } ], "features": [ { "attributes": { "OBJECTID": 19, "PRECINCTID": "6", "NAME": "Precinct 6 - Vote at 115 Greenough St", "COUNTY": "Norfolk", "LASTUPDATE": 'null', "LASTEDITOR": 'null', "SHAPE_Length": 15810.092868688193, "SHAPE_Area": 7070142.9764727177, "STR_NUM": "115", "STREET": "GREENOUGH ST", "ADDRESS": "115 GREENOUGH ST", "LOC_DESC": "BHS Schluntz Gymnasium, 115 Greenough Street" }, } ] } GET_LIBRARY_API_MOCK = { "features": [ { "attributes": { "OBJECTID": 1, "FACILITYID": "None", "NAME": "Coolidge Corner Library", "OWNER": "Town of Brookline", "OWNTYPE": "None", "SUBTYPEFIELD": "None", "FEATURECODE": "None", "FULLADDR": "31 Pleasant St, Brookline, MA 02446", "AGENCYURL": "http://www.brooklinelibrary.org/", "OPERDAYS": "Other", "OPERHOURS": "Other", "CONTACT": "None", "PHONE": "617-730-2380", "EMAIL": "http://www.brooklinelibrary.org/about/email" }, "geometry": { "x": -7916949.550832789, "y": 5212579.537906414 } }, { "attributes": { "OBJECTID": 2, "FACILITYID": "None", "NAME": "Main Library", "OWNER": "Town of Brookline", "OWNTYPE": "None", "SUBTYPEFIELD": "None", "FEATURECODE": "None", "FULLADDR": "361 Washington St, Brookline, MA 02445", "AGENCYURL": "http://www.brooklinelibrary.org/", "OPERDAYS": "Other", "OPERHOURS": "Other", "CONTACT": "None", "PHONE": "617-730-2370", "EMAIL": "http://www.brooklinelibrary.org/about/email" }, "geometry": { "x": -7917194.260973867, "y": 5211229.5272506215 } }, { "attributes": { "OBJECTID": 3, "FACILITYID": "None", "NAME": "Putterham Branch Library", "OWNER": "Town of Brookline", "OWNTYPE": "None", "SUBTYPEFIELD": "None", "FEATURECODE": "None", "FULLADDR": "959 W Roxbury Pky, Brookline, MA 02467", "AGENCYURL": "http://www.brooklinelibrary.org/", "OPERDAYS": "Other", "OPERHOURS": "Other", "CONTACT": "None", "PHONE": "617-730-2385", "EMAIL": "http://www.brooklinelibrary.org/about/email" }, "geometry": { "x": -7920391.679580264, "y": 5206399.414108847 } } ] } GET_SCHOOL_DISTRICT_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "NAME": "School Name", "DISTRCTNAME": "School District Name", "SCHOOLAREA": "Area in Square Miles", "LASTUPDATE": "Last Update Date", "LASTEDITOR": "Last Editor" }, "features": [ { "attributes": { "OBJECTID": 1, "NAME": "Brookline School", "DISTRCTNAME": "Brookline", "SCHOOLAREA": "1", "LASTUPDATE": None, "LASTEDITOR": None }, "geometry": { "rings": [[[-7920615.96685251,5205180.75934551]]] } } ] } NO_RESULTS_GET_SCHOOL_DISTRICT_API_MOCK = { "displayFieldName": "NAME", "fieldAliases": { "OBJECTID": "OBJECTID", "NAME": "School Name", "DISTRCTNAME": "School District Name", "SCHOOLAREA": "Area in Square Miles", "LASTUPDATE": "Last Update Date", "LASTEDITOR": "Last Editor" }, "features": [] }
get_police_station_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'FACILITYID': 'Facility Identifier', 'NAME': 'Name of Facility', 'OWNER': 'Owner Name', 'OWNTYPE': 'Owner Type', 'SUBTYPEFIELD': 'Subtype Field', 'FEATURECODE': 'Feature Code', 'FULLADDR': 'Full Address', 'AGENCYURL': 'Website', 'OPERDAYS': 'Operational Days', 'OPERHOURS': 'Operational Hours', 'CONTACT': 'Contact Name', 'PHONE': 'Phone', 'EMAIL': 'Email'}, 'features': [{'attributes': {'OBJECTID': 1, 'FACILITYID': None, 'NAME': 'Brookline Public Safety HQ', 'OWNER': 'Town of Brookline', 'OWNTYPE': None, 'SUBTYPEFIELD': None, 'FEATURECODE': None, 'FULLADDR': '350 Washington St, Brookline, MA 02445', 'AGENCYURL': 'http://www.brooklinepolice.com/', 'OPERDAYS': 'Other', 'OPERHOURS': 'Other', 'CONTACT': None, 'PHONE': '617-730-2222', 'EMAIL': None}, 'geometry': {'x': -71.12140930363722, 'y': 42.333789044263746}}]} no_results_get_police_station_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'FACILITYID': 'Facility Identifier', 'NAME': 'Name of Facility', 'OWNER': 'Owner Name', 'OWNTYPE': 'Owner Type', 'SUBTYPEFIELD': 'Subtype Field', 'FEATURECODE': 'Feature Code', 'FULLADDR': 'Full Address', 'AGENCYURL': 'Website', 'OPERDAYS': 'Operational Days', 'OPERHOURS': 'Operational Hours', 'CONTACT': 'Contact Name', 'PHONE': 'Phone', 'EMAIL': 'Email'}, 'features': []} geocode_mock = {'spatialReference': {'wkid': 4326, 'latestWkid': 4326}, 'x': -71.1206143363372, 'y': 42.33402053551253, 'z': 0} location_mock = {'x': -71.1206143363372, 'y': 42.33402053551253, 'z': 0} spacial_reference_mock = {'wkid': 4326, 'latestWkid': 4326} address_candidate_mock = {'address': '333 WASHINGTON ST', 'location': {'x': -71.1206143363372, 'y': 42.33402053551253, 'z': 0}, 'score': 100, 'attributes': {'Loc_name': 'Building', 'Score': 100, 'Match_addr': '333 WASHINGTON ST'}} get_address_candidates_api_mock = {'spatialReference': {'wkid': 4326, 'latestWkid': 4326}, 'candidates': [{'address': '333 WASHINGTON ST', 'location': {'x': -71.1206143363372, 'y': 42.33402053551253, 'z': 0}, 'score': 100, 'attributes': {'Loc_name': 'Building', 'Score': 100, 'Match_addr': '333 WASHINGTON ST'}}]} geocode_address_mock = {'geometry': {'x': -7917110.640673582, 'y': 5211147.471469648}} get_trash_pickup_api_mock = {'displayFieldName': 'DISTRICTID', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'DISTRICTID': 'District ID', 'NAME': 'District Name', 'AGENCY': 'Agency', 'AGENCYURL': 'Website', 'CONTACT': 'Contact Name', 'PHONE': 'Phone', 'EMAIL': 'Email', 'SUBTYPEFIELD': 'Subtype Field', 'SCHEDULE': 'Schedule', 'DESCRIPT': 'Additional Information', 'MONDAY': 'Monday', 'TUESDAY': 'Tuesday', 'WEDNESDAY': 'Wednesday', 'THURSDAY': 'Thursday', 'FRIDAY': 'Friday', 'SATURDAY': 'Saturday', 'SUNDAY': 'Sunday', 'GlobalID': 'GlobalID'}, 'features': [{'attributes': {'OBJECTID': 2, 'DISTRICTID': '1', 'NAME': 'Wednesday Trash', 'AGENCY': 'Town of Brookline', 'AGENCYURL': 'http://ma-brookline.civicplus.com/820/Trash-Recycling-Information', 'CONTACT': 'Brookline Public Works', 'PHONE': 'null', 'EMAIL': 'null', 'SUBTYPEFIELD': 0, 'SCHEDULE': 'Weekly', 'DESCRIPT': 'http://ma-brookline.civicplus.com/834/Holiday-Schedule-Christmas-Tree-Pick-Up', 'MONDAY': 'No', 'TUESDAY': 'No', 'WEDNESDAY': 'Yes', 'THURSDAY': 'No', 'FRIDAY': 'No', 'SATURDAY': 'No', 'SUNDAY': 'No', 'GlobalID': '{20538BBF-EB83-4CCD-B1E8-93EF36554413}'}, 'geometry': {'x': -71.12140930363722, 'y': 42.333789044263746}}]} no_response_trash_pickup_api_mock = {'displayFieldName': 'DISTRICTID', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'DISTRICTID': 'District ID', 'NAME': 'District Name', 'AGENCY': 'Agency', 'AGENCYURL': 'Website', 'CONTACT': 'Contact Name', 'PHONE': 'Phone', 'EMAIL': 'Email', 'SUBTYPEFIELD': 'Subtype Field', 'SCHEDULE': 'Schedule', 'DESCRIPT': 'Additional Information', 'MONDAY': 'Monday', 'TUESDAY': 'Tuesday', 'WEDNESDAY': 'Wednesday', 'THURSDAY': 'Thursday', 'FRIDAY': 'Friday', 'SATURDAY': 'Saturday', 'SUNDAY': 'Sunday', 'GlobalID': 'GlobalID'}, 'features': []} no_response_voting_precinct_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'PRECINCTID': 'Precinct ID', 'NAME': 'Precinct Name', 'COUNTY': 'County', 'LASTUPDATE': 'Last Update Date', 'LASTEDITOR': 'Last Editor', 'SHAPE_Length': 'SHAPE_Length', 'SHAPE_Area': 'SHAPE_Area', 'STR_NUM': 'STR_NUM', 'STREET': 'STREET', 'ADDRESS': 'ADDRESS', 'LOC_DESC': 'LOC_DESC'}, 'geometryType': 'esriGeometryPolygon', 'spatialReference': {'wkid': 102100, 'latestWkid': 3857}, 'fields': [{'name': 'OBJECTID', 'type': 'esriFieldTypeOID', 'alias': 'OBJECTID'}, {'name': 'PRECINCTID', 'type': 'esriFieldTypeString', 'alias': 'Precinct ID', 'length': 10}, {'name': 'NAME', 'type': 'esriFieldTypeString', 'alias': 'Precinct Name', 'length': 50}, {'name': 'COUNTY', 'type': 'esriFieldTypeString', 'alias': 'County', 'length': 50}, {'name': 'LASTUPDATE', 'type': 'esriFieldTypeDate', 'alias': 'Last Update Date', 'length': 8}, {'name': 'LASTEDITOR', 'type': 'esriFieldTypeString', 'alias': 'Last Editor', 'length': 50}, {'name': 'SHAPE_Length', 'type': 'esriFieldTypeDouble', 'alias': 'SHAPE_Length'}, {'name': 'SHAPE_Area', 'type': 'esriFieldTypeDouble', 'alias': 'SHAPE_Area'}, {'name': 'STR_NUM', 'type': 'esriFieldTypeString', 'alias': 'STR_NUM', 'length': 8}, {'name': 'STREET', 'type': 'esriFieldTypeString', 'alias': 'STREET', 'length': 32}, {'name': 'ADDRESS', 'type': 'esriFieldTypeString', 'alias': 'ADDRESS', 'length': 64}, {'name': 'LOC_DESC', 'type': 'esriFieldTypeString', 'alias': 'LOC_DESC', 'length': 128}], 'features': []} get_voting_precinct_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'PRECINCTID': 'Precinct ID', 'NAME': 'Precinct Name', 'COUNTY': 'County', 'LASTUPDATE': 'Last Update Date', 'LASTEDITOR': 'Last Editor', 'SHAPE_Length': 'SHAPE_Length', 'SHAPE_Area': 'SHAPE_Area', 'STR_NUM': 'STR_NUM', 'STREET': 'STREET', 'ADDRESS': 'ADDRESS', 'LOC_DESC': 'LOC_DESC'}, 'geometryType': 'esriGeometryPolygon', 'spatialReference': {'wkid': 102100, 'latestWkid': 3857}, 'fields': [{'name': 'OBJECTID', 'type': 'esriFieldTypeOID', 'alias': 'OBJECTID'}, {'name': 'PRECINCTID', 'type': 'esriFieldTypeString', 'alias': 'Precinct ID', 'length': 10}, {'name': 'NAME', 'type': 'esriFieldTypeString', 'alias': 'Precinct Name', 'length': 50}, {'name': 'COUNTY', 'type': 'esriFieldTypeString', 'alias': 'County', 'length': 50}, {'name': 'LASTUPDATE', 'type': 'esriFieldTypeDate', 'alias': 'Last Update Date', 'length': 8}, {'name': 'LASTEDITOR', 'type': 'esriFieldTypeString', 'alias': 'Last Editor', 'length': 50}, {'name': 'SHAPE_Length', 'type': 'esriFieldTypeDouble', 'alias': 'SHAPE_Length'}, {'name': 'SHAPE_Area', 'type': 'esriFieldTypeDouble', 'alias': 'SHAPE_Area'}, {'name': 'STR_NUM', 'type': 'esriFieldTypeString', 'alias': 'STR_NUM', 'length': 8}, {'name': 'STREET', 'type': 'esriFieldTypeString', 'alias': 'STREET', 'length': 32}, {'name': 'ADDRESS', 'type': 'esriFieldTypeString', 'alias': 'ADDRESS', 'length': 64}, {'name': 'LOC_DESC', 'type': 'esriFieldTypeString', 'alias': 'LOC_DESC', 'length': 128}], 'features': [{'attributes': {'OBJECTID': 19, 'PRECINCTID': '6', 'NAME': 'Precinct 6 - Vote at 115 Greenough St', 'COUNTY': 'Norfolk', 'LASTUPDATE': 'null', 'LASTEDITOR': 'null', 'SHAPE_Length': 15810.092868688193, 'SHAPE_Area': 7070142.976472718, 'STR_NUM': '115', 'STREET': 'GREENOUGH ST', 'ADDRESS': '115 GREENOUGH ST', 'LOC_DESC': 'BHS Schluntz Gymnasium, 115 Greenough Street'}}]} get_library_api_mock = {'features': [{'attributes': {'OBJECTID': 1, 'FACILITYID': 'None', 'NAME': 'Coolidge Corner Library', 'OWNER': 'Town of Brookline', 'OWNTYPE': 'None', 'SUBTYPEFIELD': 'None', 'FEATURECODE': 'None', 'FULLADDR': '31 Pleasant St, Brookline, MA 02446', 'AGENCYURL': 'http://www.brooklinelibrary.org/', 'OPERDAYS': 'Other', 'OPERHOURS': 'Other', 'CONTACT': 'None', 'PHONE': '617-730-2380', 'EMAIL': 'http://www.brooklinelibrary.org/about/email'}, 'geometry': {'x': -7916949.550832789, 'y': 5212579.537906414}}, {'attributes': {'OBJECTID': 2, 'FACILITYID': 'None', 'NAME': 'Main Library', 'OWNER': 'Town of Brookline', 'OWNTYPE': 'None', 'SUBTYPEFIELD': 'None', 'FEATURECODE': 'None', 'FULLADDR': '361 Washington St, Brookline, MA 02445', 'AGENCYURL': 'http://www.brooklinelibrary.org/', 'OPERDAYS': 'Other', 'OPERHOURS': 'Other', 'CONTACT': 'None', 'PHONE': '617-730-2370', 'EMAIL': 'http://www.brooklinelibrary.org/about/email'}, 'geometry': {'x': -7917194.260973867, 'y': 5211229.5272506215}}, {'attributes': {'OBJECTID': 3, 'FACILITYID': 'None', 'NAME': 'Putterham Branch Library', 'OWNER': 'Town of Brookline', 'OWNTYPE': 'None', 'SUBTYPEFIELD': 'None', 'FEATURECODE': 'None', 'FULLADDR': '959 W Roxbury Pky, Brookline, MA 02467', 'AGENCYURL': 'http://www.brooklinelibrary.org/', 'OPERDAYS': 'Other', 'OPERHOURS': 'Other', 'CONTACT': 'None', 'PHONE': '617-730-2385', 'EMAIL': 'http://www.brooklinelibrary.org/about/email'}, 'geometry': {'x': -7920391.679580264, 'y': 5206399.414108847}}]} get_school_district_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'NAME': 'School Name', 'DISTRCTNAME': 'School District Name', 'SCHOOLAREA': 'Area in Square Miles', 'LASTUPDATE': 'Last Update Date', 'LASTEDITOR': 'Last Editor'}, 'features': [{'attributes': {'OBJECTID': 1, 'NAME': 'Brookline School', 'DISTRCTNAME': 'Brookline', 'SCHOOLAREA': '1', 'LASTUPDATE': None, 'LASTEDITOR': None}, 'geometry': {'rings': [[[-7920615.96685251, 5205180.75934551]]]}}]} no_results_get_school_district_api_mock = {'displayFieldName': 'NAME', 'fieldAliases': {'OBJECTID': 'OBJECTID', 'NAME': 'School Name', 'DISTRCTNAME': 'School District Name', 'SCHOOLAREA': 'Area in Square Miles', 'LASTUPDATE': 'Last Update Date', 'LASTEDITOR': 'Last Editor'}, 'features': []}
#https://www.hackerrank.com/contests/w35/challenges/lucky-purchase/problem books= {} ; n= int(input()) ; for a0 in range(n): string = input().split() ; books[string[0]] = string[1] ; books = list(books.items()) ; mini = books[0] ; for pair in books: if pair[1].count('7')+pair[1].count('4')!=len(pair[1]): continue; if(pair[1].count('7')==pair[1].count('4')): if(int(pair[1])<int(mini[1])): mini = pair ; print(mini[0] if mini[1].count('7')==mini[1].count('4') and mini[1].count('7')+mini[1].count('4')==len(mini[1]) else "-1") ;
books = {} n = int(input()) for a0 in range(n): string = input().split() books[string[0]] = string[1] books = list(books.items()) mini = books[0] for pair in books: if pair[1].count('7') + pair[1].count('4') != len(pair[1]): continue if pair[1].count('7') == pair[1].count('4'): if int(pair[1]) < int(mini[1]): mini = pair print(mini[0] if mini[1].count('7') == mini[1].count('4') and mini[1].count('7') + mini[1].count('4') == len(mini[1]) else '-1')
n = int(input("_gram? - ")) s = input("words: ") grams = [] for i in range(len(s)): op = "" for x in range(i, i + n): if x >= len(s): op = "" break op += s[x] if op != "": grams.append(op) print(op) grams.sort() print(grams)
n = int(input('_gram? - ')) s = input('words: ') grams = [] for i in range(len(s)): op = '' for x in range(i, i + n): if x >= len(s): op = '' break op += s[x] if op != '': grams.append(op) print(op) grams.sort() print(grams)
VERSION = '0.1.6b0' ENV_LIST = ['clustering-v0', 'clustering-v1', 'clustering-v2', 'clustering-v3', 'classification-v0']
version = '0.1.6b0' env_list = ['clustering-v0', 'clustering-v1', 'clustering-v2', 'clustering-v3', 'classification-v0']
# Solution A # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: ListNode) -> ListNode: prev = None cur = head while cur: tmp = cur.next cur.next = prev prev = cur cur = tmp return prev # Solution B # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: ListNode) -> ListNode: if not head or not head.next: return head newhead = self.reverseList(head.next) head.next.next = head head.next = None return newhead
class Solution: def reverse_list(self, head: ListNode) -> ListNode: prev = None cur = head while cur: tmp = cur.next cur.next = prev prev = cur cur = tmp return prev class Solution: def reverse_list(self, head: ListNode) -> ListNode: if not head or not head.next: return head newhead = self.reverseList(head.next) head.next.next = head head.next = None return newhead
a=[2, 3, 5, 7] print(a) a.reverse() print(a)
a = [2, 3, 5, 7] print(a) a.reverse() print(a)
def binarySearch(arr, x, left, right): if right <= left: if right + 1 <= len(arr): return right + 1 return -1 mid = (left + right) // 2 if x <= arr[mid]: return binarySearch(arr, x, left, mid) else: return binarySearch(arr, x, mid + 1, right) def read_input(): n = input() arr = list(map(int, input().split())) x = int(input()) return arr, x if __name__ == '__main__': arr, x = read_input() index = binarySearch(arr, x, left=0, right=len(arr)) index2 = binarySearch(arr, 2*x, left=0, right=len(arr)) print(index, index2)
def binary_search(arr, x, left, right): if right <= left: if right + 1 <= len(arr): return right + 1 return -1 mid = (left + right) // 2 if x <= arr[mid]: return binary_search(arr, x, left, mid) else: return binary_search(arr, x, mid + 1, right) def read_input(): n = input() arr = list(map(int, input().split())) x = int(input()) return (arr, x) if __name__ == '__main__': (arr, x) = read_input() index = binary_search(arr, x, left=0, right=len(arr)) index2 = binary_search(arr, 2 * x, left=0, right=len(arr)) print(index, index2)
river = { 'nile': 'egypt', 'huang': 'china', 'mississippi':'USA' } for key, value in river.items(): print("The " + key + "runs through " + value +".") for name in (river.keys()): print(name) for country in (river.values()): print(country)
river = {'nile': 'egypt', 'huang': 'china', 'mississippi': 'USA'} for (key, value) in river.items(): print('The ' + key + 'runs through ' + value + '.') for name in river.keys(): print(name) for country in river.values(): print(country)
# (C) Datadog, Inc. 2022-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) __version__ = '1.1.0'
__version__ = '1.1.0'
def printList(): li=list() for i in range(1,21): li.append(i**2) print(li) printList()
def print_list(): li = list() for i in range(1, 21): li.append(i ** 2) print(li) print_list()
def count_substring(string, sub_string): res = 0 len_sub = len(sub_string) for i in range(len(string) - len_sub + 1): if string[i:i + len_sub] == sub_string: res += 1 i += 1 return res
def count_substring(string, sub_string): res = 0 len_sub = len(sub_string) for i in range(len(string) - len_sub + 1): if string[i:i + len_sub] == sub_string: res += 1 i += 1 return res
_base_="../base-ucmerced-config-simpleaug.py" # this will merge with the parent model=dict(pretrained='data/basetrain_chkpts/moco_v2_800ep.pth') # epoch related total_iters=5000 checkpoint_config = dict(interval=total_iters) model = dict( pretrained='data/basetrain_chkpts/moco_v2_800ep.pth', backbone=dict( norm_train=True, frozen_stages=4, ) ) optimizer = dict(type='SGD', lr=0.1, weight_decay=0.0001, momentum=0.9)
_base_ = '../base-ucmerced-config-simpleaug.py' model = dict(pretrained='data/basetrain_chkpts/moco_v2_800ep.pth') total_iters = 5000 checkpoint_config = dict(interval=total_iters) model = dict(pretrained='data/basetrain_chkpts/moco_v2_800ep.pth', backbone=dict(norm_train=True, frozen_stages=4)) optimizer = dict(type='SGD', lr=0.1, weight_decay=0.0001, momentum=0.9)
def finferensi(berat, pinjam, harga): linguistik = [] derajat = [] for bk, bv in berat.items(): for pk, pv in pinjam.items(): for hk, hv in harga.items(): # rule 1 if bk == 'ringan' and pk == 'sebentar' and hk == 'rendah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 2 if bk == 'ringan' and pk == 'sebentar' and hk == 'menengah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 3 if bk == 'ringan' and pk == 'sebentar' and hk == 'tinggi': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 4 if bk == 'ringan' and pk == 'menengah' and hk == 'rendah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 5 if bk == 'ringan' and pk == 'menengah' and hk == 'menengah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 6 if bk == 'ringan' and pk == 'menengah' and hk == 'tinggi': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 7 if bk == 'ringan' and pk == 'lama' and hk == 'rendah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 8 if bk == 'ringan' and pk == 'lama' and hk == 'menengah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 9 if bk == 'ringan' and pk == 'lama' and hk == 'tinggi': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 10 if bk == 'sedang' and pk == 'sebentar' and hk == 'rendah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 11 if bk == 'sedang' and pk == 'sebentar' and hk == 'menengah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 12 if bk == 'sedang' and pk == 'sebentar' and hk == 'tinggi': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 13 if bk == 'sedang' and pk == 'menengah' and hk == 'rendah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 14 if bk == 'sedang' and pk == 'menengah' and hk == 'menengah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 15 if bk == 'sedang' and pk == 'menengah' and hk == 'tinggi': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 16 if bk == 'sedang' and pk == 'lama' and hk == 'rendah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 17 if bk == 'sedang' and pk == 'lama' and hk == 'menengah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 18 if bk == 'sedang' and pk == 'lama' and hk == 'tinggi': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 19 if bk == 'berat' and pk == 'sebentar' and hk == 'rendah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 20 if bk == 'berat' and pk == 'sebentar' and hk == 'menengah': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 21 if bk == 'berat' and pk == 'sebentar' and hk == 'tinggi': linguistik.append('kecil') derajat.append(min(bv, pv, hv)) # rule 22 if bk == 'berat' and pk == 'menengah' and hk == 'rendah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 23 if bk == 'berat' and pk == 'menengah' and hk == 'menengah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 24 if bk == 'berat' and pk == 'menengah' and hk == 'tinggi': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 25 if bk == 'berat' and pk == 'lama' and hk == 'rendah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 26 if bk == 'berat' and pk == 'lama' and hk == 'menengah': linguistik.append('besar') derajat.append(min(bv, pv, hv)) # rule 27 if bk == 'berat' and pk == 'lama' and hk == 'tinggi': linguistik.append('besar') derajat.append(min(bv, pv, hv)) i = 0 templinguistik = [] tempderajat = [] for index,nama in enumerate(linguistik): if derajat[i] != 0: templinguistik.append(nama) tempderajat.append(derajat[i]) print(f'{index+1}. {nama}: {derajat[i]}') i += 1 tkecil = [] tbesar = [] for li,de in zip (templinguistik,tempderajat): if li == 'kecil': tkecil.append(de) else: tbesar.append(de) if tkecil == []: tkecil = [0,0] elif tbesar == []: tbesar = [0,0] kecil = max(tkecil) besar = max(tbesar) output = dict(kecil=kecil,besar=besar) return output
def finferensi(berat, pinjam, harga): linguistik = [] derajat = [] for (bk, bv) in berat.items(): for (pk, pv) in pinjam.items(): for (hk, hv) in harga.items(): if bk == 'ringan' and pk == 'sebentar' and (hk == 'rendah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'sebentar' and (hk == 'menengah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'sebentar' and (hk == 'tinggi'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'menengah' and (hk == 'rendah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'menengah' and (hk == 'menengah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'menengah' and (hk == 'tinggi'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'lama' and (hk == 'rendah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'lama' and (hk == 'menengah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'ringan' and pk == 'lama' and (hk == 'tinggi'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'sebentar' and (hk == 'rendah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'sebentar' and (hk == 'menengah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'sebentar' and (hk == 'tinggi'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'menengah' and (hk == 'rendah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'menengah' and (hk == 'menengah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'menengah' and (hk == 'tinggi'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'lama' and (hk == 'rendah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'lama' and (hk == 'menengah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'sedang' and pk == 'lama' and (hk == 'tinggi'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'sebentar' and (hk == 'rendah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'sebentar' and (hk == 'menengah'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'sebentar' and (hk == 'tinggi'): linguistik.append('kecil') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'menengah' and (hk == 'rendah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'menengah' and (hk == 'menengah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'menengah' and (hk == 'tinggi'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'lama' and (hk == 'rendah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'lama' and (hk == 'menengah'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) if bk == 'berat' and pk == 'lama' and (hk == 'tinggi'): linguistik.append('besar') derajat.append(min(bv, pv, hv)) i = 0 templinguistik = [] tempderajat = [] for (index, nama) in enumerate(linguistik): if derajat[i] != 0: templinguistik.append(nama) tempderajat.append(derajat[i]) print(f'{index + 1}. {nama}: {derajat[i]}') i += 1 tkecil = [] tbesar = [] for (li, de) in zip(templinguistik, tempderajat): if li == 'kecil': tkecil.append(de) else: tbesar.append(de) if tkecil == []: tkecil = [0, 0] elif tbesar == []: tbesar = [0, 0] kecil = max(tkecil) besar = max(tbesar) output = dict(kecil=kecil, besar=besar) return output
# Booknames.py class Booknames: def usfmBookId(self, bookName): books = { 'Genesis': 'GEN', 'Exodus': 'EXO', 'Leviticus': 'LEV', 'Numbers': 'NUM', 'Deuteronomy': 'DEU', 'Joshua': 'JOS', 'Judges': 'JDG', 'Ruth': 'RUT', '1Samuel': '1SA', '2Samuel': '2SA', '1Kings': '1KI', '2Kings': '2KI', '1Chronicles': '1CH', '2Chronicles': '2CH', 'Ezra': 'EZR', '1Ezra': 'EZR', 'Nehemiah': 'NEH', '2Ezra': 'NEH', 'Esther': 'EST', 'Job': 'JOB', 'Psalms': 'PSA', 'PSALM': 'PSA', 'Proverbs': 'PRO', 'PROVERBS': 'PRO', 'Ecclesiastes': 'ECC', 'SongofSongs': 'SNG', 'Song': 'SNG', 'Isaiah': 'ISA', 'Jeremiah': 'JER', 'Lamentations': 'LAM', 'Ezekiel': 'EZK', 'Daniel': 'DAN', 'Hosea': 'HOS', 'Joel': 'JOL', 'Amos': 'AMO', 'Obadiah': 'OBA', 'Jonah': 'JON', 'Micah': 'MIC', 'Nahum': 'NAM', 'Habakkuk': 'HAB', 'Zephaniah': 'ZEP', 'Haggai': 'HAG', 'Zechariah': 'ZEC', 'Zachariah': 'ZEC', 'Malachi': 'MAL', 'Matthew': 'MAT', 'Mark': 'MRK', 'Luke': 'LUK', 'John': 'JHN', 'Acts': 'ACT', 'Romans': 'ROM', '1Corinthians': '1CO', '2Corinthians': '2CO', 'Galatians': 'GAL', 'Ephesians': 'EPH', 'Philippians': 'PHP', 'Phil': 'PHP', 'Colossians': 'COL', '1Thess': '1TH', '1Thessalonians':'1TH', '2Thess': '2TH', '2Thessalonians':'2TH', '1Timothy': '1TI', '2Timothy': '2TI', 'Titus': 'TIT', 'Philemon': 'PHM', 'Hebrews': 'HEB', 'James': 'JAS', '1Peter': '1PE', '2Peter': '2PE', '1John': '1JN', '2John': '2JN', '3John': '3JN', 'Jude': 'JUD', 'Revelation': 'REV', 'Tobit': 'TOB', 'Judith': 'JDT', 'Wisdom': 'WIS', 'Sirach': 'SIR', 'Baruch': 'BAR', 'EpistJeremia': 'LJE', 'EpistJeremiah':'LJE', '1Maccabees': '1MA', '2Maccabees': '2MA', '3Maccabees': '3MA', '4Maccabees': '4MA', # Spanish 'Exodo': 'EXO', 'Levitico': 'LEV', 'Levetico': 'LEV', 'Numeros': 'NUM', 'Deuteronomio': 'DEU', 'Josue': 'JOS', 'Jueces': 'JDG', 'Rut': 'RUT', '1Reyes': '1KI', '2Reyes': '2KI', '1Cronicas': '1CH', '2Cronicas': '2CH', 'Esdras': 'EZR', 'Nehemias': 'NEH', 'Ester': 'EST', 'Salmos': 'PSA', 'Salmo': 'PSA', 'salmo': 'PSA', 'Proverbios': 'PRO', 'Eclesiastes': 'ECC', 'Cantaras': 'SNG', 'Isaias': 'ISA', 'Jeremias': 'JER', 'Lamentacione': 'LAM', 'Ezequiel': 'EZK', 'Oseas': 'HOS', 'Abdias': 'OBA', 'Jonas': 'JON', 'Miqueas': 'MIC', 'Habacuc': 'HAB', 'Sofonias': 'ZEP', 'Hageo': 'HAG', 'Zacarias': 'ZEC', 'Malaquias': 'MAL', 'San_Mateo': 'MAT', 'San_Marcos': 'MRK', 'San_Lucas': 'LUK', 'San_Juan': 'JHN', 'San_1uan': 'JHN', 'Hechos': 'ACT', 'Romanos': 'ROM', '1Corintios': '1CO', '2Corintios': '2CO', 'Galatas': 'GAL', 'Efesios': 'EPH', 'Filipenses': 'PHP', 'Colosenses': 'COL', '1Tes': '1TH', '2Tes': '2TH', '1Timoteo': '1TI', '2Timoteo': '2TI', 'Tito': 'TIT', 'Filemon': 'PHM', 'Hebreos': 'HEB', 'Santiago': 'JAS', '1San_Pedro': '1PE', '2San_Pedro': '2PE', '1San_Juan': '1JN', '1San_1uan': '1JN', '2San_Juan': '2JN', '2San_1uan': '2JN', '3San_Juan': '3JN', '3San_1uan': '3JN', 'Judas': 'JUD', '1udas': 'JUD', 'Apocalipsis': 'REV', # Spanish Capitulo 'Genesis_Capitulo': 'GEN', 'Exodo_Capitulo': 'EXO', 'Levetico_Capitulo': 'LEV', 'Numeros_Capitulo': 'NUM', 'Deuteronomio_Capitulo':'DEU', 'Josue_Capitulo': 'JOS', 'Jueces_Capitulo': 'JDG', 'Ruth_Capitulo': 'RUT', '1Samuel_Capitulo': '1SA', '2Samuel_Capitulo': '2SA', '1Reyes_Capitulo': '1KI', '2Reyes_Capitulo': '2KI', 'Esdras_Capitulo': 'EZR', 'Esther_Capitulo': 'EST', 'Job_Capitulo': 'JOB', 'Salmos_Capitulo': 'PSA', 'Proverbios_Capitulo': 'PRO', 'Isaias_Capitulo': 'ISA', 'Ezequiel_Capitulo': 'EZK', 'Daniel_Capitulo': 'DAN', 'Oseas_Capitulo': 'HOS', 'Joel_Capitulo': 'JOL', 'Amos_Capitulo': 'AMO', 'Abdias_Capitulo': 'OBA', 'Jonas_Capitulo': 'JON', 'Miqueas_Capitulo': 'MIC', 'Nahum_Capitulo': 'NAM', 'Habacuc_Capitulo': 'HAB', 'Sofonias_Capitulo': 'ZEP', # Spanish Book Codes, included as names, because not standard 'GEN': 'GEN', 'EXO': 'EXO', 'LEV': 'LEV', 'NUM': 'NUM', 'DEU': 'DEU', 'JOS': 'JOS', 'JUE': 'JDG', '1SA': '1SA', '2SA': '2SA', '1RE': '1KI', '2RE': '2KI', '1CR': '1CH', '2CR': '2CH', 'ESD': 'EZR', 'NEH': 'NEH', 'JOB': 'JOB', 'SAL': 'PSA', 'PRO': 'PRO', 'ISA': 'ISA', 'EZE': 'EZK', 'DAN': 'DAN', 'JOE': 'JOL', 'AMO': 'AMO', 'MIQ': 'MIC', 'HAB': 'HAB', 'SOF': 'ZEP', 'ZAC': 'ZEC', 'MAL': 'MAL', # Portuguese 'Juizes': 'JDG', '1Reis': '1KI', '2Reis': '2KI', 'Neemias': 'NEH', 'Cantares': 'SNG', 'Lamentacoes': 'LAM', 'Obadias': 'OBA', 'Naum': 'NAM', 'Ageu': 'HAG', 'S_Mateus': 'MAT', 'S_Marcos': 'MRK', 'S_Lucas': 'LUK', 'S_Joao': 'JHN', 'Atos': 'ACT', 'Colossenses': 'COL', '1Tess': '1TH', '2Tess': '2TH', 'Hebreus': 'HEB', 'S_Tiago': 'JAS', '1Pedro': '1PE', '2Pedro': '2PE', '1S_Joao': '1JN', '2S_Joao': '2JN', '3S_Joao': '3JN', 'S_Judas': 'JUD', 'Apocalipse': 'REV', # French 'Genese': 'GEN', 'Exode': 'EXO', 'Levitique': 'LEV', 'Nombres': 'NUM', 'Deuteronome': 'DEU', 'Juges': 'JDG', '1Rois': '1KI', '2Rois': '2KI', '1Chroniques': '1CH', '2Chroniques': '2CH', 'Nehemie': 'NEH', 'Psaumes': 'PSA', 'Proverbes': 'PRO', 'Ecclesiaste': 'ECC', 'Cantiques': 'SNG', 'Esaie': 'ISA', 'Jeremie': 'JER', 'Lamentation': 'LAM', 'Osee': 'HOS', 'Michee': 'MIC', 'Sophonie': 'ZEP', 'Aggee': 'HAG', 'Zacharie': 'ZEC', 'Malachie': 'MAL', # Indonesian 'Matius': 'MAT', 'Markus': 'MRK', 'Lukas': 'LUK', 'Yohanes': 'JHN', 'Kisah_Rasul': 'ACT', 'Roma': 'ROM', '1Korintus': '1CO', '2Korintus': '2CO', 'Galatia': 'GAL', 'Efesus': 'EPH', 'Filipi': 'PHP', 'Kolose': 'COL', '1Tesalonika': '1TH', '2Tesalonika': '2TH', '1Timotius': '1TI', '2Timotius': '2TI', 'Ibrani': 'HEB', 'Yakobus': 'JAS', '1Petrus': '1PE', '2Petrus': '2PE', '1Yohanes': '1JN', '2Yohanes': '2JN', '3Yohanes': '3JN', 'Yudas': 'JUD', 'Wahyu': 'REV', # Maasina Fulfulde 'Matthieu': 'MAT', 'Marc': 'MRK', 'Luc': 'LUK', 'Jean': 'JHN', 'Actes': 'ACT', 'Romains': 'ROM', '1Corinthiens': '1CO', '2Corinthiens': '2CO', 'Galates': 'GAL', 'Ephesiens': 'EPH', 'Philippiens': 'PHP', 'Colossiens': 'COL', '1Thess': '1TH', '2Thess': '2TH', '1Timothee': '1TI', '2Timothee': '2TI', 'Tite': 'TIT', 'Philemon': 'PHM', 'Hebreux': 'HEB', 'Jacques': 'JAS', '1Pierre': '1PE', '2Pierre': '2PE', '1Jean': '1JN', '2Jean': '2JN', '3Jean': '3JN', 'Jude': 'JUD', 'Apocalypse': 'REV', # Kolibugan Subanonm Southern Phillipines skn 'PONOGNAAN': 'GEN', 'YUNUS': 'JON', 'MARKUS': 'MRK', 'LUKAS': 'LUK', 'YAHIYA': 'JHN', 'MGA_GINANG': 'ACT', 'GALATIYA': 'GAL', 'EPESUS': 'EPH', 'PILIPI': 'PHP', 'KOLOSAS': 'COL', '1TESALONIKA': '1TH', '2TESALONIKA': '2TH', '1TIMUTI': '1TI', '2TIMUTI': '2TI', 'TITUS': 'TIT', 'YAKUB': 'JAS', # Malay 'Kejadian': 'GEN', 'Keluaran': 'EXO', 'Imamat': 'LEV', 'Bilangan': 'NUM', 'Ulangan': 'DEU', 'Yosua': 'JOS', 'Hakim-hakim': 'JDG', '1Raja-raja': '1KI', '2Raja-raja': '2KI', '1Tawarikh': '1CH', '2Tawarikh': '2CH', 'Nehemia': 'NEH', 'Ayub': 'JOB', 'Mazmur': 'PSA', 'Amsal': 'PRO', 'Pengkhotbah': 'ECC', 'Kidung': 'SNG', 'Yesaya': 'ISA', 'Yeremia': 'JER', 'Ratapan': 'LAM', 'Yehezkiel': 'EZK', 'Yoel': 'JOL', 'Obaja': 'OBA', 'Yunus': 'JON', 'Mikha': 'MIC', 'Habakuk': 'HAB', 'Zefanya': 'ZEP', 'Hagai': 'HAG', 'Zakharia': 'ZEC', 'Maleakhi': 'MAL' } result = books.get(bookName, None) return result #NT Order: #Traditional #Russian #Plautdietsch #Finnish #OT Order: #Masoretic-Christian #Masoretic-Tanakh #Septuagint #Vulgate ## ## Old Testament Book orders ## def TraditionalOT(self, sequence): traditional = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZR', 'A16': 'NEH', 'A17': 'EST', 'A18': 'JOB', 'A19': 'PSA', 'A20': 'PRO', 'A21': 'ECC', 'A22': 'SNG', 'A23': 'ISA', 'A24': 'JER', 'A25': 'LAM', 'A26': 'EZK', 'A27': 'DAN', 'A28': 'HOS', 'A29': 'JOL', 'A30': 'AMO', 'A31': 'OBA', 'A32': 'JON', 'A33': 'MIC', 'A34': 'NAM', 'A35': 'HAB', 'A36': 'ZEP', 'A37': 'HAG', 'A38': 'ZEC', 'A39': 'MAL' } return traditional.get(sequence, None) def MasoreticChristianOT(self, sequence): return self.TraditionalOT(sequence) def HebrewOT(self, sequence): hebrew = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': '1SA', 'A09': '2SA', 'A10': '1KI', 'A11': '2KI', 'A12': 'ISA', 'A13': 'JER', 'A14': 'EZK', 'A15': 'HOS', 'A16': 'JOL', 'A17': 'AMO', 'A18': 'OBA', 'A19': 'JON', 'A20': 'MIC', 'A21': 'NAM', 'A22': 'HAB', 'A23': 'ZEP', 'A24': 'HAG', 'A25': 'ZEC', 'A26': 'MAL', 'A27': 'PSA', 'A28': 'PRO', 'A29': 'JOB', 'A30': 'SNG', 'A31': 'RUT', 'A32': 'LAM', 'A33': 'ECC', 'A34': 'EST', 'A35': 'DAN', 'A36': 'EZR', 'A37': 'NEH', 'A38': '1CH', 'A39': '2CH' } return hebrew.get(sequence, None) def MasoreticTanakhOT(self, sequence): return self.HebrewOT(sequence) def CatholicOT(self, sequence): # This is my name for it. It must be corrected catholic = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZR', 'A16': 'NEH', 'A17': 'TOB', 'A18': 'JDT', 'A19': 'EST', 'A20': '1MA', 'A21': '2MA', 'A22': 'JOB', 'A23': 'PSA', 'A24': 'PRO', 'A25': 'ECC', 'A26': 'SNG', 'A27': 'WIS', 'A28': 'SIR', 'A29': 'ISA', 'A30': 'JER', 'A31': 'LAM', 'A32': 'BAR', 'A33': 'EZK', 'A34': 'DAG', 'A35': 'HOS', 'A36': 'JOL', 'A37': 'AMO', 'A38': 'OBA', 'A39': 'JON', 'A40': 'MIC', 'A41': 'NAM', 'A42': 'HAB', 'A43': 'ZEP', 'A44': 'HAG', 'A45': 'ZEC', 'A46': 'MAL' } return catholic.get(sequence, None) def VulgateOT(self, sequence): vulgate = { ## To be added when sequence is known } return vulgate.get(sequence, None) def SeptuagintOT(self, sequence): septuagint = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZA', # Not sure EZA is correct codeEsdras 1 'A16': 'EZR', 'A17': 'NEH', 'A18': 'TOB', # Tobit 'A19': 'JDT', # Judith 'A20': 'ESG', # EST with additions 'A21': '1MA', # 1Maccabees 'A22': '2MA', # 2Maccabees 'A23': '3MA', # 3Maccabees 'A24': 'PSA', # I think prayer of Manassa goes here 'A25': 'JOB', 'A26': 'PRO', 'A27': 'ECC', 'A28': 'SNG', 'A29': 'WIS', # Wisdom of Solomon 'A30': 'SIR', # Sirach # Does Psalm of Solomon go here 'A31': 'HOS', 'A32': 'AMO', 'A33': 'MIC', 'A34': 'JOL', 'A35': 'OBA', 'A36': 'JON', 'A37': 'NAM', 'A38': 'HAB', 'A39': 'ZEP', 'A40': 'HAG', 'A41': 'ZEC', 'A42': 'MAL', 'A43': 'ISA', 'A44': 'JER', 'A45': 'BAR', # First book of Baruch 'A46': 'LAM', 'A47': 'LJE', # Epistle Jeremiah 'A48': 'EZK', 'A49': 'DAG', # DAN with additions 'A50': '4MA' # 4Maccabees } return septuagint.get(sequence, None) def Septuagint2OT(self, sequence): septuagint = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZA', # Not sure EZA is correct codeEsdras 1 'A16': 'EZR', 'A17': 'NEH', 'A18': 'TOB', # Tobit 'A19': 'JDT', # Judith 'A20': 'ESG', # EST with additions 'A21': '1MA', # 1Maccabees 'A22': '2MA', # 2Maccabees 'A23': '3MA', # 3Maccabees 'A24': 'PSA', 'A25': 'PS2', # special code for PSA 151 'A26': 'JOB', 'A27': 'PRO', 'A28': 'ECC', 'A29': 'SNG', 'A30': 'WIS', # Wisdom of Solomon 'A31': 'SIR', # Sirach # Does Psalm of Solomon go here 'A32': 'HOS', 'A33': 'AMO', 'A34': 'MIC', 'A35': 'JOL', 'A36': 'OBA', 'A37': 'JON', 'A38': 'NAM', 'A39': 'HAB', 'A40': 'ZEP', 'A41': 'HAG', 'A42': 'ZEC', 'A43': 'MAL', 'A44': 'ISA', 'A45': 'JER', 'A46': 'BAR', # First book of Baruch 'A47': 'LAM', 'A48': 'LJE', # Epistle Jeremiah 'A49': 'EZK', 'A50': 'DAG', # DAN with additions 'A51': 'SUS', # Susanna 'A52': '4MA' # 4Maccabees } return septuagint.get(sequence, None) def DutchTraditionalOT(self, sequence): dutch = { ## To be added when sequence is known } return dutch.get(sequence, None) def TRNNTMOT(self, sequence): trnntm = { 'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1CH', 'A12': '2CH', 'A13': '2KI', 'A14': 'ISA', 'A15': 'JER', 'A16': 'MIC', 'A17': 'HOS', 'A18': 'PSA', 'A19': 'ZEC', 'A20': 'JON' } return trnntm.get(sequence, None) ## ## New Testament book orders ## def TraditionalNT(self, sequence): traditional = { 'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': 'HEB', 'B20': 'JAS', 'B21': '1PE', 'B22': '2PE', 'B23': '1JN', 'B24': '2JN', 'B25': '3JN', 'B26': 'JUD', 'B27': 'REV' } return traditional.get(sequence, None) def RussianNT(self, sequence): russian = { 'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'JAS', 'B07': '1PE', 'B08': '2PE', 'B09': '1JN', 'B10': '2JN', 'B11': '3JN', 'B12': 'JUD', 'B13': 'ROM', 'B14': '1CO', 'B15': '2CO', 'B16': 'GAL', 'B17': 'EPH', 'B18': 'PHP', 'B19': 'COL', 'B20': '1TH', 'B21': '2TH', 'B22': '1TI', 'B23': '2TI', 'B24': 'TIT', 'B25': 'PHM', 'B26': 'HEB', 'B27': 'REV' } return russian.get(sequence, None) def PlautdietschNT(self, sequence): diestsch = { 'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': '1PE', 'B20': '2PE', 'B21': '1JN', 'B22': '2JN', 'B23': '3JN', 'B24': 'HEB', 'B25': 'JAS', 'B26': 'JUD', 'B27': 'REV' } return diestsch.get(sequence, None) def FinnishNT(self, sequence): finnish = { 'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': 'HEB', 'B20': '1PE', 'B21': '2PE', 'B22': '1JN', 'B23': '2JN', 'B24': '3JN', 'B25': 'JAS', 'B26': 'JUD', 'B27': 'REV' } return finnish.get(sequence, None)
class Booknames: def usfm_book_id(self, bookName): books = {'Genesis': 'GEN', 'Exodus': 'EXO', 'Leviticus': 'LEV', 'Numbers': 'NUM', 'Deuteronomy': 'DEU', 'Joshua': 'JOS', 'Judges': 'JDG', 'Ruth': 'RUT', '1Samuel': '1SA', '2Samuel': '2SA', '1Kings': '1KI', '2Kings': '2KI', '1Chronicles': '1CH', '2Chronicles': '2CH', 'Ezra': 'EZR', '1Ezra': 'EZR', 'Nehemiah': 'NEH', '2Ezra': 'NEH', 'Esther': 'EST', 'Job': 'JOB', 'Psalms': 'PSA', 'PSALM': 'PSA', 'Proverbs': 'PRO', 'PROVERBS': 'PRO', 'Ecclesiastes': 'ECC', 'SongofSongs': 'SNG', 'Song': 'SNG', 'Isaiah': 'ISA', 'Jeremiah': 'JER', 'Lamentations': 'LAM', 'Ezekiel': 'EZK', 'Daniel': 'DAN', 'Hosea': 'HOS', 'Joel': 'JOL', 'Amos': 'AMO', 'Obadiah': 'OBA', 'Jonah': 'JON', 'Micah': 'MIC', 'Nahum': 'NAM', 'Habakkuk': 'HAB', 'Zephaniah': 'ZEP', 'Haggai': 'HAG', 'Zechariah': 'ZEC', 'Zachariah': 'ZEC', 'Malachi': 'MAL', 'Matthew': 'MAT', 'Mark': 'MRK', 'Luke': 'LUK', 'John': 'JHN', 'Acts': 'ACT', 'Romans': 'ROM', '1Corinthians': '1CO', '2Corinthians': '2CO', 'Galatians': 'GAL', 'Ephesians': 'EPH', 'Philippians': 'PHP', 'Phil': 'PHP', 'Colossians': 'COL', '1Thess': '1TH', '1Thessalonians': '1TH', '2Thess': '2TH', '2Thessalonians': '2TH', '1Timothy': '1TI', '2Timothy': '2TI', 'Titus': 'TIT', 'Philemon': 'PHM', 'Hebrews': 'HEB', 'James': 'JAS', '1Peter': '1PE', '2Peter': '2PE', '1John': '1JN', '2John': '2JN', '3John': '3JN', 'Jude': 'JUD', 'Revelation': 'REV', 'Tobit': 'TOB', 'Judith': 'JDT', 'Wisdom': 'WIS', 'Sirach': 'SIR', 'Baruch': 'BAR', 'EpistJeremia': 'LJE', 'EpistJeremiah': 'LJE', '1Maccabees': '1MA', '2Maccabees': '2MA', '3Maccabees': '3MA', '4Maccabees': '4MA', 'Exodo': 'EXO', 'Levitico': 'LEV', 'Levetico': 'LEV', 'Numeros': 'NUM', 'Deuteronomio': 'DEU', 'Josue': 'JOS', 'Jueces': 'JDG', 'Rut': 'RUT', '1Reyes': '1KI', '2Reyes': '2KI', '1Cronicas': '1CH', '2Cronicas': '2CH', 'Esdras': 'EZR', 'Nehemias': 'NEH', 'Ester': 'EST', 'Salmos': 'PSA', 'Salmo': 'PSA', 'salmo': 'PSA', 'Proverbios': 'PRO', 'Eclesiastes': 'ECC', 'Cantaras': 'SNG', 'Isaias': 'ISA', 'Jeremias': 'JER', 'Lamentacione': 'LAM', 'Ezequiel': 'EZK', 'Oseas': 'HOS', 'Abdias': 'OBA', 'Jonas': 'JON', 'Miqueas': 'MIC', 'Habacuc': 'HAB', 'Sofonias': 'ZEP', 'Hageo': 'HAG', 'Zacarias': 'ZEC', 'Malaquias': 'MAL', 'San_Mateo': 'MAT', 'San_Marcos': 'MRK', 'San_Lucas': 'LUK', 'San_Juan': 'JHN', 'San_1uan': 'JHN', 'Hechos': 'ACT', 'Romanos': 'ROM', '1Corintios': '1CO', '2Corintios': '2CO', 'Galatas': 'GAL', 'Efesios': 'EPH', 'Filipenses': 'PHP', 'Colosenses': 'COL', '1Tes': '1TH', '2Tes': '2TH', '1Timoteo': '1TI', '2Timoteo': '2TI', 'Tito': 'TIT', 'Filemon': 'PHM', 'Hebreos': 'HEB', 'Santiago': 'JAS', '1San_Pedro': '1PE', '2San_Pedro': '2PE', '1San_Juan': '1JN', '1San_1uan': '1JN', '2San_Juan': '2JN', '2San_1uan': '2JN', '3San_Juan': '3JN', '3San_1uan': '3JN', 'Judas': 'JUD', '1udas': 'JUD', 'Apocalipsis': 'REV', 'Genesis_Capitulo': 'GEN', 'Exodo_Capitulo': 'EXO', 'Levetico_Capitulo': 'LEV', 'Numeros_Capitulo': 'NUM', 'Deuteronomio_Capitulo': 'DEU', 'Josue_Capitulo': 'JOS', 'Jueces_Capitulo': 'JDG', 'Ruth_Capitulo': 'RUT', '1Samuel_Capitulo': '1SA', '2Samuel_Capitulo': '2SA', '1Reyes_Capitulo': '1KI', '2Reyes_Capitulo': '2KI', 'Esdras_Capitulo': 'EZR', 'Esther_Capitulo': 'EST', 'Job_Capitulo': 'JOB', 'Salmos_Capitulo': 'PSA', 'Proverbios_Capitulo': 'PRO', 'Isaias_Capitulo': 'ISA', 'Ezequiel_Capitulo': 'EZK', 'Daniel_Capitulo': 'DAN', 'Oseas_Capitulo': 'HOS', 'Joel_Capitulo': 'JOL', 'Amos_Capitulo': 'AMO', 'Abdias_Capitulo': 'OBA', 'Jonas_Capitulo': 'JON', 'Miqueas_Capitulo': 'MIC', 'Nahum_Capitulo': 'NAM', 'Habacuc_Capitulo': 'HAB', 'Sofonias_Capitulo': 'ZEP', 'GEN': 'GEN', 'EXO': 'EXO', 'LEV': 'LEV', 'NUM': 'NUM', 'DEU': 'DEU', 'JOS': 'JOS', 'JUE': 'JDG', '1SA': '1SA', '2SA': '2SA', '1RE': '1KI', '2RE': '2KI', '1CR': '1CH', '2CR': '2CH', 'ESD': 'EZR', 'NEH': 'NEH', 'JOB': 'JOB', 'SAL': 'PSA', 'PRO': 'PRO', 'ISA': 'ISA', 'EZE': 'EZK', 'DAN': 'DAN', 'JOE': 'JOL', 'AMO': 'AMO', 'MIQ': 'MIC', 'HAB': 'HAB', 'SOF': 'ZEP', 'ZAC': 'ZEC', 'MAL': 'MAL', 'Juizes': 'JDG', '1Reis': '1KI', '2Reis': '2KI', 'Neemias': 'NEH', 'Cantares': 'SNG', 'Lamentacoes': 'LAM', 'Obadias': 'OBA', 'Naum': 'NAM', 'Ageu': 'HAG', 'S_Mateus': 'MAT', 'S_Marcos': 'MRK', 'S_Lucas': 'LUK', 'S_Joao': 'JHN', 'Atos': 'ACT', 'Colossenses': 'COL', '1Tess': '1TH', '2Tess': '2TH', 'Hebreus': 'HEB', 'S_Tiago': 'JAS', '1Pedro': '1PE', '2Pedro': '2PE', '1S_Joao': '1JN', '2S_Joao': '2JN', '3S_Joao': '3JN', 'S_Judas': 'JUD', 'Apocalipse': 'REV', 'Genese': 'GEN', 'Exode': 'EXO', 'Levitique': 'LEV', 'Nombres': 'NUM', 'Deuteronome': 'DEU', 'Juges': 'JDG', '1Rois': '1KI', '2Rois': '2KI', '1Chroniques': '1CH', '2Chroniques': '2CH', 'Nehemie': 'NEH', 'Psaumes': 'PSA', 'Proverbes': 'PRO', 'Ecclesiaste': 'ECC', 'Cantiques': 'SNG', 'Esaie': 'ISA', 'Jeremie': 'JER', 'Lamentation': 'LAM', 'Osee': 'HOS', 'Michee': 'MIC', 'Sophonie': 'ZEP', 'Aggee': 'HAG', 'Zacharie': 'ZEC', 'Malachie': 'MAL', 'Matius': 'MAT', 'Markus': 'MRK', 'Lukas': 'LUK', 'Yohanes': 'JHN', 'Kisah_Rasul': 'ACT', 'Roma': 'ROM', '1Korintus': '1CO', '2Korintus': '2CO', 'Galatia': 'GAL', 'Efesus': 'EPH', 'Filipi': 'PHP', 'Kolose': 'COL', '1Tesalonika': '1TH', '2Tesalonika': '2TH', '1Timotius': '1TI', '2Timotius': '2TI', 'Ibrani': 'HEB', 'Yakobus': 'JAS', '1Petrus': '1PE', '2Petrus': '2PE', '1Yohanes': '1JN', '2Yohanes': '2JN', '3Yohanes': '3JN', 'Yudas': 'JUD', 'Wahyu': 'REV', 'Matthieu': 'MAT', 'Marc': 'MRK', 'Luc': 'LUK', 'Jean': 'JHN', 'Actes': 'ACT', 'Romains': 'ROM', '1Corinthiens': '1CO', '2Corinthiens': '2CO', 'Galates': 'GAL', 'Ephesiens': 'EPH', 'Philippiens': 'PHP', 'Colossiens': 'COL', '1Thess': '1TH', '2Thess': '2TH', '1Timothee': '1TI', '2Timothee': '2TI', 'Tite': 'TIT', 'Philemon': 'PHM', 'Hebreux': 'HEB', 'Jacques': 'JAS', '1Pierre': '1PE', '2Pierre': '2PE', '1Jean': '1JN', '2Jean': '2JN', '3Jean': '3JN', 'Jude': 'JUD', 'Apocalypse': 'REV', 'PONOGNAAN': 'GEN', 'YUNUS': 'JON', 'MARKUS': 'MRK', 'LUKAS': 'LUK', 'YAHIYA': 'JHN', 'MGA_GINANG': 'ACT', 'GALATIYA': 'GAL', 'EPESUS': 'EPH', 'PILIPI': 'PHP', 'KOLOSAS': 'COL', '1TESALONIKA': '1TH', '2TESALONIKA': '2TH', '1TIMUTI': '1TI', '2TIMUTI': '2TI', 'TITUS': 'TIT', 'YAKUB': 'JAS', 'Kejadian': 'GEN', 'Keluaran': 'EXO', 'Imamat': 'LEV', 'Bilangan': 'NUM', 'Ulangan': 'DEU', 'Yosua': 'JOS', 'Hakim-hakim': 'JDG', '1Raja-raja': '1KI', '2Raja-raja': '2KI', '1Tawarikh': '1CH', '2Tawarikh': '2CH', 'Nehemia': 'NEH', 'Ayub': 'JOB', 'Mazmur': 'PSA', 'Amsal': 'PRO', 'Pengkhotbah': 'ECC', 'Kidung': 'SNG', 'Yesaya': 'ISA', 'Yeremia': 'JER', 'Ratapan': 'LAM', 'Yehezkiel': 'EZK', 'Yoel': 'JOL', 'Obaja': 'OBA', 'Yunus': 'JON', 'Mikha': 'MIC', 'Habakuk': 'HAB', 'Zefanya': 'ZEP', 'Hagai': 'HAG', 'Zakharia': 'ZEC', 'Maleakhi': 'MAL'} result = books.get(bookName, None) return result def traditional_ot(self, sequence): traditional = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZR', 'A16': 'NEH', 'A17': 'EST', 'A18': 'JOB', 'A19': 'PSA', 'A20': 'PRO', 'A21': 'ECC', 'A22': 'SNG', 'A23': 'ISA', 'A24': 'JER', 'A25': 'LAM', 'A26': 'EZK', 'A27': 'DAN', 'A28': 'HOS', 'A29': 'JOL', 'A30': 'AMO', 'A31': 'OBA', 'A32': 'JON', 'A33': 'MIC', 'A34': 'NAM', 'A35': 'HAB', 'A36': 'ZEP', 'A37': 'HAG', 'A38': 'ZEC', 'A39': 'MAL'} return traditional.get(sequence, None) def masoretic_christian_ot(self, sequence): return self.TraditionalOT(sequence) def hebrew_ot(self, sequence): hebrew = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': '1SA', 'A09': '2SA', 'A10': '1KI', 'A11': '2KI', 'A12': 'ISA', 'A13': 'JER', 'A14': 'EZK', 'A15': 'HOS', 'A16': 'JOL', 'A17': 'AMO', 'A18': 'OBA', 'A19': 'JON', 'A20': 'MIC', 'A21': 'NAM', 'A22': 'HAB', 'A23': 'ZEP', 'A24': 'HAG', 'A25': 'ZEC', 'A26': 'MAL', 'A27': 'PSA', 'A28': 'PRO', 'A29': 'JOB', 'A30': 'SNG', 'A31': 'RUT', 'A32': 'LAM', 'A33': 'ECC', 'A34': 'EST', 'A35': 'DAN', 'A36': 'EZR', 'A37': 'NEH', 'A38': '1CH', 'A39': '2CH'} return hebrew.get(sequence, None) def masoretic_tanakh_ot(self, sequence): return self.HebrewOT(sequence) def catholic_ot(self, sequence): catholic = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZR', 'A16': 'NEH', 'A17': 'TOB', 'A18': 'JDT', 'A19': 'EST', 'A20': '1MA', 'A21': '2MA', 'A22': 'JOB', 'A23': 'PSA', 'A24': 'PRO', 'A25': 'ECC', 'A26': 'SNG', 'A27': 'WIS', 'A28': 'SIR', 'A29': 'ISA', 'A30': 'JER', 'A31': 'LAM', 'A32': 'BAR', 'A33': 'EZK', 'A34': 'DAG', 'A35': 'HOS', 'A36': 'JOL', 'A37': 'AMO', 'A38': 'OBA', 'A39': 'JON', 'A40': 'MIC', 'A41': 'NAM', 'A42': 'HAB', 'A43': 'ZEP', 'A44': 'HAG', 'A45': 'ZEC', 'A46': 'MAL'} return catholic.get(sequence, None) def vulgate_ot(self, sequence): vulgate = {} return vulgate.get(sequence, None) def septuagint_ot(self, sequence): septuagint = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZA', 'A16': 'EZR', 'A17': 'NEH', 'A18': 'TOB', 'A19': 'JDT', 'A20': 'ESG', 'A21': '1MA', 'A22': '2MA', 'A23': '3MA', 'A24': 'PSA', 'A25': 'JOB', 'A26': 'PRO', 'A27': 'ECC', 'A28': 'SNG', 'A29': 'WIS', 'A30': 'SIR', 'A31': 'HOS', 'A32': 'AMO', 'A33': 'MIC', 'A34': 'JOL', 'A35': 'OBA', 'A36': 'JON', 'A37': 'NAM', 'A38': 'HAB', 'A39': 'ZEP', 'A40': 'HAG', 'A41': 'ZEC', 'A42': 'MAL', 'A43': 'ISA', 'A44': 'JER', 'A45': 'BAR', 'A46': 'LAM', 'A47': 'LJE', 'A48': 'EZK', 'A49': 'DAG', 'A50': '4MA'} return septuagint.get(sequence, None) def septuagint2_ot(self, sequence): septuagint = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1KI', 'A12': '2KI', 'A13': '1CH', 'A14': '2CH', 'A15': 'EZA', 'A16': 'EZR', 'A17': 'NEH', 'A18': 'TOB', 'A19': 'JDT', 'A20': 'ESG', 'A21': '1MA', 'A22': '2MA', 'A23': '3MA', 'A24': 'PSA', 'A25': 'PS2', 'A26': 'JOB', 'A27': 'PRO', 'A28': 'ECC', 'A29': 'SNG', 'A30': 'WIS', 'A31': 'SIR', 'A32': 'HOS', 'A33': 'AMO', 'A34': 'MIC', 'A35': 'JOL', 'A36': 'OBA', 'A37': 'JON', 'A38': 'NAM', 'A39': 'HAB', 'A40': 'ZEP', 'A41': 'HAG', 'A42': 'ZEC', 'A43': 'MAL', 'A44': 'ISA', 'A45': 'JER', 'A46': 'BAR', 'A47': 'LAM', 'A48': 'LJE', 'A49': 'EZK', 'A50': 'DAG', 'A51': 'SUS', 'A52': '4MA'} return septuagint.get(sequence, None) def dutch_traditional_ot(self, sequence): dutch = {} return dutch.get(sequence, None) def trnntmot(self, sequence): trnntm = {'A01': 'GEN', 'A02': 'EXO', 'A03': 'LEV', 'A04': 'NUM', 'A05': 'DEU', 'A06': 'JOS', 'A07': 'JDG', 'A08': 'RUT', 'A09': '1SA', 'A10': '2SA', 'A11': '1CH', 'A12': '2CH', 'A13': '2KI', 'A14': 'ISA', 'A15': 'JER', 'A16': 'MIC', 'A17': 'HOS', 'A18': 'PSA', 'A19': 'ZEC', 'A20': 'JON'} return trnntm.get(sequence, None) def traditional_nt(self, sequence): traditional = {'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': 'HEB', 'B20': 'JAS', 'B21': '1PE', 'B22': '2PE', 'B23': '1JN', 'B24': '2JN', 'B25': '3JN', 'B26': 'JUD', 'B27': 'REV'} return traditional.get(sequence, None) def russian_nt(self, sequence): russian = {'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'JAS', 'B07': '1PE', 'B08': '2PE', 'B09': '1JN', 'B10': '2JN', 'B11': '3JN', 'B12': 'JUD', 'B13': 'ROM', 'B14': '1CO', 'B15': '2CO', 'B16': 'GAL', 'B17': 'EPH', 'B18': 'PHP', 'B19': 'COL', 'B20': '1TH', 'B21': '2TH', 'B22': '1TI', 'B23': '2TI', 'B24': 'TIT', 'B25': 'PHM', 'B26': 'HEB', 'B27': 'REV'} return russian.get(sequence, None) def plautdietsch_nt(self, sequence): diestsch = {'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': '1PE', 'B20': '2PE', 'B21': '1JN', 'B22': '2JN', 'B23': '3JN', 'B24': 'HEB', 'B25': 'JAS', 'B26': 'JUD', 'B27': 'REV'} return diestsch.get(sequence, None) def finnish_nt(self, sequence): finnish = {'B01': 'MAT', 'B02': 'MRK', 'B03': 'LUK', 'B04': 'JHN', 'B05': 'ACT', 'B06': 'ROM', 'B07': '1CO', 'B08': '2CO', 'B09': 'GAL', 'B10': 'EPH', 'B11': 'PHP', 'B12': 'COL', 'B13': '1TH', 'B14': '2TH', 'B15': '1TI', 'B16': '2TI', 'B17': 'TIT', 'B18': 'PHM', 'B19': 'HEB', 'B20': '1PE', 'B21': '2PE', 'B22': '1JN', 'B23': '2JN', 'B24': '3JN', 'B25': 'JAS', 'B26': 'JUD', 'B27': 'REV'} return finnish.get(sequence, None)
# pylint: disable=missing-function-docstring, missing-module-docstring/ a = 4 a += 5.0
a = 4 a += 5.0
# encoding: utf-8 class FastCGIError(Exception): pass # Values for type component of FCGI_Header FCGI_BEGIN_REQUEST = 1 FCGI_ABORT_REQUEST = 2 FCGI_END_REQUEST = 3 FCGI_PARAMS = 4 FCGI_STDIN = 5 FCGI_STDOUT = 6 FCGI_STDERR = 7 FCGI_DATA = 8 FCGI_GET_VALUES = 9 FCGI_GET_VALUES_RESULT = 10 FCGI_UNKNOWN_TYPE = 11 typeNames = { FCGI_BEGIN_REQUEST : 'fcgi_begin_request', FCGI_ABORT_REQUEST : 'fcgi_abort_request', FCGI_END_REQUEST : 'fcgi_end_request', FCGI_PARAMS : 'fcgi_params', FCGI_STDIN : 'fcgi_stdin', FCGI_STDOUT : 'fcgi_stdout', FCGI_STDERR : 'fcgi_stderr', FCGI_DATA : 'fcgi_data', FCGI_GET_VALUES : 'fcgi_get_values', FCGI_GET_VALUES_RESULT: 'fcgi_get_values_result', FCGI_UNKNOWN_TYPE : 'fcgi_unknown_type'} # Mask for flags component of FCGI_BeginRequestBody FCGI_KEEP_CONN = 1 # Values for role component of FCGI_BeginRequestBody FCGI_RESPONDER = 1 FCGI_AUTHORIZER = 2 FCGI_FILTER = 3 # Values for protocolStatus component of FCGI_EndRequestBody FCGI_REQUEST_COMPLETE = 0 FCGI_CANT_MPX_CONN = 1 FCGI_OVERLOADED = 2 FCGI_UNKNOWN_ROLE = 3 FCGI_MAX_PACKET_LEN = 0xFFFF class Record(object): def __init__(self, type, reqId, content='', version=1): self.version = version self.type = type self.reqId = reqId self.content = content self.length = len(content) if self.length > FCGI_MAX_PACKET_LEN: raise ValueError("Record length too long: %d > %d" % (self.length, FCGI_MAX_PACKET_LEN)) if self.length % 8 != 0: self.padding = 8 - (self.length & 7) else: self.padding = 0 self.reserved = 0 def fromHeaderString(clz, rec): self = object.__new__(clz) self.version = ord(rec[0]) self.type = ord(rec[1]) self.reqId = (ord(rec[2])<<8)|ord(rec[3]) self.length = (ord(rec[4])<<8)|ord(rec[5]) self.padding = ord(rec[6]) self.reserved = ord(rec[7]) self.content = None return self fromHeaderString = classmethod(fromHeaderString) def toOutputString(self): return "%c%c%c%c%c%c%c%c" % ( self.version, self.type, (self.reqId&0xFF00)>>8, self.reqId&0xFF, (self.length&0xFF00)>>8, self.length & 0xFF, self.padding, self.reserved) + self.content + '\0'*self.padding def totalLength(self): return 8 + self.length + self.padding def __repr__(self): return "<FastCGIRecord version=%d type=%d(%s) reqId=%d>" % ( self.version, self.type, typeNames.get(self.type), self.reqId) def parseNameValues(s): ''' @param s: String containing valid name/value data, of the form: 'namelength + valuelength + name + value' repeated 0 or more times. See C{fastcgi.writeNameValue} for how to create this string. @return: Generator of tuples of the form (name, value) ''' off = 0 while off < len(s): nameLen = ord(s[off]) off += 1 if nameLen&0x80: nameLen=(nameLen&0x7F)<<24 | ord(s[off])<<16 | ord(s[off+1])<<8 | ord(s[off+2]) off += 3 valueLen=ord(s[off]) off += 1 if valueLen&0x80: valueLen=(valueLen&0x7F)<<24 | ord(s[off])<<16 | ord(s[off+1])<<8 | ord(s[off+2]) off += 3 yield (s[off:off+nameLen], s[off+nameLen:off+nameLen+valueLen]) off += nameLen + valueLen def getLenBytes(length): if length<0x80: return chr(length) elif 0 < length <= 0x7FFFFFFF: return (chr(0x80|(length>>24)&0x7F) + chr((length>>16)&0xFF) + chr((length>>8)&0xFF) + chr(length&0xFF)) else: raise ValueError("Name length too long.") def writeNameValue(name, value): return getLenBytes(len(name)) + getLenBytes(len(value)) + name + value class Channel(object): maxConnections = 100 reqId = 0 request = None ## High level protocol def packetReceived(self, packet): ''' @param packet: instance of C{fastcgi.Record}. @raise: FastCGIError on invalid version or where the type does not exist in funName ''' if packet.version != 1: raise FastCGIError("FastCGI packet received with version != 1") funName = typeNames.get(packet.type) if funName is None: raise FastCGIError("Unknown FastCGI packet type: %d" % packet.type) getattr(self, funName)(packet) def fcgi_get_values(self, packet): if packet.reqId != 0: raise ValueError("Should be 0!") content = "" for name,value in parseNameValues(packet.content): outval = None if name == "FCGI_MAX_CONNS": outval = str(self.maxConnections) elif name == "FCGI_MAX_REQS": outval = str(self.maxConnections) elif name == "FCGI_MPXS_CONNS": outval = "0" if outval: content += writeNameValue(name, outval) self.writePacket(Record(FCGI_GET_VALUES_RESULT, 0, content)) def fcgi_unknown_type(self, packet): # Unused, reserved for future expansion pass def fcgi_begin_request(self, packet): role = ord(packet.content[0])<<8 | ord(packet.content[1]) flags = ord(packet.content[2]) if packet.reqId == 0: raise ValueError("ReqId shouldn't be 0!") if self.reqId != 0: self.writePacket(Record(FCGI_END_REQUEST, self.reqId, "\0\0\0\0"+chr(FCGI_CANT_MPX_CONN)+"\0\0\0")) if role != FCGI_RESPONDER: self.writePacket(Record(FCGI_END_REQUEST, self.reqId, "\0\0\0\0"+chr(FCGI_UNKNOWN_ROLE)+"\0\0\0")) self.reqId = packet.reqId self.keepalive = flags & FCGI_KEEP_CONN self.params = "" def fcgi_abort_request(self, packet): if packet.reqId != self.reqId: return self.request.connectionLost() def fcgi_params(self, packet): if packet.reqId != self.reqId: return # I don't feel like doing the work to incrementally parse this stupid # protocol, so we'll just buffer all the params data before parsing. if not packet.content: self.makeRequest(dict(parseNameValues(self.params))) self.request.process() self.params += packet.content def fcgi_stdin(self, packet): if packet.reqId != self.reqId: return if not packet.content: self.request.handleContentComplete() else: self.request.handleContentChunk(packet.content) def fcgi_data(self, packet): # For filter roles only, which is currently unsupported. pass def write(self, data): if len(data) > FCGI_MAX_PACKET_LEN: n = 0 while 1: d = data[n*FCGI_MAX_PACKET_LEN:(n+1)*FCGI_MAX_PACKET_LEN] if not d: break self.write(d) return self.writePacket(Record(FCGI_STDOUT, self.reqId, data)) def writeHeaders(self, code, headers): l = [] code_message = responsecode.RESPONSES.get(code, "Unknown Status") l.append("Status: %s %s\n" % (code, code_message)) if headers is not None: for name, valuelist in headers.getAllRawHeaders(): for value in valuelist: l.append("%s: %s\n" % (name, value)) l.append('\n') self.write(''.join(l)) def finish(self): if self.request is None: raise RuntimeError("Request.finish called when no request was outstanding.") self.writePacket(Record(FCGI_END_REQUEST, self.reqId, "\0\0\0\0"+chr(FCGI_REQUEST_COMPLETE)+"\0\0\0")) del self.reqId, self.request if not self.keepalive: self.transport.loseConnection() ## Low level protocol paused = False _lastRecord = None recvd = "" def writePacket(self, packet): data = packet.toOutputString() #print "Writing record", packet, repr(data) self.sock.sendall(data) def read(self, length): s = '' while len(s) < length: s = self.sock.recv(length-len(s)) return s def readPacket(self, tryrecv=False): if tryrecv: try: self.sock.setblocking(0) s = self.sock.recv(8) finally: self.sock.setblocking(1) if len(s) < 8: s += self.read(8-len(s)) else: s = self.read(8) record = Record.fromHeaderString(s) if record.length: record.content = self.read(record.length) if record.padding: self.read(record.padding) return record def dataReceived(self, recd): self.recvd = self.recvd + recd record = self._lastRecord self._lastRecord = None while len(self.recvd) >= 8 and not self.paused: if record is None: record = Record.fromHeaderString(self.recvd[:8]) if len(self.recvd) < record.totalLength(): self._lastRecord = record break record.content = self.recvd[8:record.length+8] self.recvd = self.recvd[record.totalLength():] self.packetReceived(record) record = None def pauseProducing(self): self.paused = True self.transport.pauseProducing() def resumeProducing(self): self.paused = False self.transport.resumeProducing() self.dataReceived('') def stopProducing(self): self.paused = True self.transport.stopProducing()
class Fastcgierror(Exception): pass fcgi_begin_request = 1 fcgi_abort_request = 2 fcgi_end_request = 3 fcgi_params = 4 fcgi_stdin = 5 fcgi_stdout = 6 fcgi_stderr = 7 fcgi_data = 8 fcgi_get_values = 9 fcgi_get_values_result = 10 fcgi_unknown_type = 11 type_names = {FCGI_BEGIN_REQUEST: 'fcgi_begin_request', FCGI_ABORT_REQUEST: 'fcgi_abort_request', FCGI_END_REQUEST: 'fcgi_end_request', FCGI_PARAMS: 'fcgi_params', FCGI_STDIN: 'fcgi_stdin', FCGI_STDOUT: 'fcgi_stdout', FCGI_STDERR: 'fcgi_stderr', FCGI_DATA: 'fcgi_data', FCGI_GET_VALUES: 'fcgi_get_values', FCGI_GET_VALUES_RESULT: 'fcgi_get_values_result', FCGI_UNKNOWN_TYPE: 'fcgi_unknown_type'} fcgi_keep_conn = 1 fcgi_responder = 1 fcgi_authorizer = 2 fcgi_filter = 3 fcgi_request_complete = 0 fcgi_cant_mpx_conn = 1 fcgi_overloaded = 2 fcgi_unknown_role = 3 fcgi_max_packet_len = 65535 class Record(object): def __init__(self, type, reqId, content='', version=1): self.version = version self.type = type self.reqId = reqId self.content = content self.length = len(content) if self.length > FCGI_MAX_PACKET_LEN: raise value_error('Record length too long: %d > %d' % (self.length, FCGI_MAX_PACKET_LEN)) if self.length % 8 != 0: self.padding = 8 - (self.length & 7) else: self.padding = 0 self.reserved = 0 def from_header_string(clz, rec): self = object.__new__(clz) self.version = ord(rec[0]) self.type = ord(rec[1]) self.reqId = ord(rec[2]) << 8 | ord(rec[3]) self.length = ord(rec[4]) << 8 | ord(rec[5]) self.padding = ord(rec[6]) self.reserved = ord(rec[7]) self.content = None return self from_header_string = classmethod(fromHeaderString) def to_output_string(self): return '%c%c%c%c%c%c%c%c' % (self.version, self.type, (self.reqId & 65280) >> 8, self.reqId & 255, (self.length & 65280) >> 8, self.length & 255, self.padding, self.reserved) + self.content + '\x00' * self.padding def total_length(self): return 8 + self.length + self.padding def __repr__(self): return '<FastCGIRecord version=%d type=%d(%s) reqId=%d>' % (self.version, self.type, typeNames.get(self.type), self.reqId) def parse_name_values(s): """ @param s: String containing valid name/value data, of the form: 'namelength + valuelength + name + value' repeated 0 or more times. See C{fastcgi.writeNameValue} for how to create this string. @return: Generator of tuples of the form (name, value) """ off = 0 while off < len(s): name_len = ord(s[off]) off += 1 if nameLen & 128: name_len = (nameLen & 127) << 24 | ord(s[off]) << 16 | ord(s[off + 1]) << 8 | ord(s[off + 2]) off += 3 value_len = ord(s[off]) off += 1 if valueLen & 128: value_len = (valueLen & 127) << 24 | ord(s[off]) << 16 | ord(s[off + 1]) << 8 | ord(s[off + 2]) off += 3 yield (s[off:off + nameLen], s[off + nameLen:off + nameLen + valueLen]) off += nameLen + valueLen def get_len_bytes(length): if length < 128: return chr(length) elif 0 < length <= 2147483647: return chr(128 | length >> 24 & 127) + chr(length >> 16 & 255) + chr(length >> 8 & 255) + chr(length & 255) else: raise value_error('Name length too long.') def write_name_value(name, value): return get_len_bytes(len(name)) + get_len_bytes(len(value)) + name + value class Channel(object): max_connections = 100 req_id = 0 request = None def packet_received(self, packet): """ @param packet: instance of C{fastcgi.Record}. @raise: FastCGIError on invalid version or where the type does not exist in funName """ if packet.version != 1: raise fast_cgi_error('FastCGI packet received with version != 1') fun_name = typeNames.get(packet.type) if funName is None: raise fast_cgi_error('Unknown FastCGI packet type: %d' % packet.type) getattr(self, funName)(packet) def fcgi_get_values(self, packet): if packet.reqId != 0: raise value_error('Should be 0!') content = '' for (name, value) in parse_name_values(packet.content): outval = None if name == 'FCGI_MAX_CONNS': outval = str(self.maxConnections) elif name == 'FCGI_MAX_REQS': outval = str(self.maxConnections) elif name == 'FCGI_MPXS_CONNS': outval = '0' if outval: content += write_name_value(name, outval) self.writePacket(record(FCGI_GET_VALUES_RESULT, 0, content)) def fcgi_unknown_type(self, packet): pass def fcgi_begin_request(self, packet): role = ord(packet.content[0]) << 8 | ord(packet.content[1]) flags = ord(packet.content[2]) if packet.reqId == 0: raise value_error("ReqId shouldn't be 0!") if self.reqId != 0: self.writePacket(record(FCGI_END_REQUEST, self.reqId, '\x00\x00\x00\x00' + chr(FCGI_CANT_MPX_CONN) + '\x00\x00\x00')) if role != FCGI_RESPONDER: self.writePacket(record(FCGI_END_REQUEST, self.reqId, '\x00\x00\x00\x00' + chr(FCGI_UNKNOWN_ROLE) + '\x00\x00\x00')) self.reqId = packet.reqId self.keepalive = flags & FCGI_KEEP_CONN self.params = '' def fcgi_abort_request(self, packet): if packet.reqId != self.reqId: return self.request.connectionLost() def fcgi_params(self, packet): if packet.reqId != self.reqId: return if not packet.content: self.makeRequest(dict(parse_name_values(self.params))) self.request.process() self.params += packet.content def fcgi_stdin(self, packet): if packet.reqId != self.reqId: return if not packet.content: self.request.handleContentComplete() else: self.request.handleContentChunk(packet.content) def fcgi_data(self, packet): pass def write(self, data): if len(data) > FCGI_MAX_PACKET_LEN: n = 0 while 1: d = data[n * FCGI_MAX_PACKET_LEN:(n + 1) * FCGI_MAX_PACKET_LEN] if not d: break self.write(d) return self.writePacket(record(FCGI_STDOUT, self.reqId, data)) def write_headers(self, code, headers): l = [] code_message = responsecode.RESPONSES.get(code, 'Unknown Status') l.append('Status: %s %s\n' % (code, code_message)) if headers is not None: for (name, valuelist) in headers.getAllRawHeaders(): for value in valuelist: l.append('%s: %s\n' % (name, value)) l.append('\n') self.write(''.join(l)) def finish(self): if self.request is None: raise runtime_error('Request.finish called when no request was outstanding.') self.writePacket(record(FCGI_END_REQUEST, self.reqId, '\x00\x00\x00\x00' + chr(FCGI_REQUEST_COMPLETE) + '\x00\x00\x00')) del self.reqId, self.request if not self.keepalive: self.transport.loseConnection() paused = False _last_record = None recvd = '' def write_packet(self, packet): data = packet.toOutputString() self.sock.sendall(data) def read(self, length): s = '' while len(s) < length: s = self.sock.recv(length - len(s)) return s def read_packet(self, tryrecv=False): if tryrecv: try: self.sock.setblocking(0) s = self.sock.recv(8) finally: self.sock.setblocking(1) if len(s) < 8: s += self.read(8 - len(s)) else: s = self.read(8) record = Record.fromHeaderString(s) if record.length: record.content = self.read(record.length) if record.padding: self.read(record.padding) return record def data_received(self, recd): self.recvd = self.recvd + recd record = self._lastRecord self._lastRecord = None while len(self.recvd) >= 8 and (not self.paused): if record is None: record = Record.fromHeaderString(self.recvd[:8]) if len(self.recvd) < record.totalLength(): self._lastRecord = record break record.content = self.recvd[8:record.length + 8] self.recvd = self.recvd[record.totalLength():] self.packetReceived(record) record = None def pause_producing(self): self.paused = True self.transport.pauseProducing() def resume_producing(self): self.paused = False self.transport.resumeProducing() self.dataReceived('') def stop_producing(self): self.paused = True self.transport.stopProducing()
match x: case Class( ): pass case Class( foo=1 ): pass case Class( foo=1, bar=2 ): pass case Class( foo=1, bar=2, ): pass
match x: case Class(): pass case Class(foo=1): pass case Class(foo=1, bar=2): pass case Class(foo=1, bar=2): pass
def deep_flatten(in_list): out_list = [] for i in in_list: if type(i) == str: out_list.append(i) elif hasattr(i,'__iter__'): out_list.extend(deep_flatten(i)) else: out_list.append(i) return out_list a = [(1,2),3,4,5,[4,4,5,6]] a = [['cats', ['carl', 'cate']],['dogs', ['darlene', 'doug']]] b = deep_flatten(a) print(b)
def deep_flatten(in_list): out_list = [] for i in in_list: if type(i) == str: out_list.append(i) elif hasattr(i, '__iter__'): out_list.extend(deep_flatten(i)) else: out_list.append(i) return out_list a = [(1, 2), 3, 4, 5, [4, 4, 5, 6]] a = [['cats', ['carl', 'cate']], ['dogs', ['darlene', 'doug']]] b = deep_flatten(a) print(b)
# Default constants DF_ADSB = 17 LAT_REF = 44.807047 # TODO put reference values LONG_REF = -0.605526 NZ=15 # Default variables fe=20*10**6; Te=1/fe Ds=1*10**6; Ts=1/Ds Fse=int(round(Ts/Te)) Ns=112 # Number of points of the signal : 1000, 112 Nfft=512 # Number of points of FFT # Default TEB parameters SIG_NB_ERROR = 100 MAX_COUNT = 500 Nteb = 11 # OK step of 1 db # Default sync parameters Tp = 8*(10**(-6)) Fpe = int(round(Tp/Te)) # Init operators to modify default config def init_ref(lat_ref, long_ref): LAT_REF = lat_ref LONG_REF = long_ref def init_fe(in_fe): # better : do lamda functions for variable recalculations fe=in_fe; Te=1/fe Fse=int(round(Ts/Te)) Fpe = int(round(Tp/Te))
df_adsb = 17 lat_ref = 44.807047 long_ref = -0.605526 nz = 15 fe = 20 * 10 ** 6 te = 1 / fe ds = 1 * 10 ** 6 ts = 1 / Ds fse = int(round(Ts / Te)) ns = 112 nfft = 512 sig_nb_error = 100 max_count = 500 nteb = 11 tp = 8 * 10 ** (-6) fpe = int(round(Tp / Te)) def init_ref(lat_ref, long_ref): lat_ref = lat_ref long_ref = long_ref def init_fe(in_fe): fe = in_fe te = 1 / fe fse = int(round(Ts / Te)) fpe = int(round(Tp / Te))
# names of hurricanes names = ['Cuba I', 'San Felipe II Okeechobee', 'Bahamas', 'Cuba II', 'CubaBrownsville', 'Tampico', 'Labor Day', 'New England', 'Carol', 'Janet', 'Carla', 'Hattie', 'Beulah', 'Camille', 'Edith', 'Anita', 'David', 'Allen', 'Gilbert', 'Hugo', 'Andrew', 'Mitch', 'Isabel', 'Ivan', 'Emily', 'Katrina', 'Rita', 'Wilma', 'Dean', 'Felix', 'Matthew', 'Irma', 'Maria', 'Michael'] # months of hurricanes months = ['October', 'September', 'September', 'November', 'August', 'September', 'September', 'September', 'September', 'September', 'September', 'October', 'September', 'August', 'September', 'September', 'August', 'August', 'September', 'September', 'August', 'October', 'September', 'September', 'July', 'August', 'September', 'October', 'August', 'September', 'October', 'September', 'September', 'October'] # years of hurricanes years = [1924, 1928, 1932, 1932, 1933, 1933, 1935, 1938, 1953, 1955, 1961, 1961, 1967, 1969, 1971, 1977, 1979, 1980, 1988, 1989, 1992, 1998, 2003, 2004, 2005, 2005, 2005, 2005, 2007, 2007, 2016, 2017, 2017, 2018] # maximum sustained winds (mph) of hurricanes max_sustained_winds = [165, 160, 160, 175, 160, 160, 185, 160, 160, 175, 175, 160, 160, 175, 160, 175, 175, 190, 185, 160, 175, 180, 165, 165, 160, 175, 180, 185, 175, 175, 165, 180, 175, 160] # areas affected by each hurricane areas_affected = [['Central America', 'Mexico', 'Cuba', 'Florida', 'The Bahamas'], ['Lesser Antilles', 'The Bahamas', 'United States East Coast', 'Atlantic Canada'], ['The Bahamas', 'Northeastern United States'], ['Lesser Antilles', 'Jamaica', 'Cayman Islands', 'Cuba', 'The Bahamas', 'Bermuda'], ['The Bahamas', 'Cuba', 'Florida', 'Texas', 'Tamaulipas'], ['Jamaica', 'Yucatn Peninsula'], ['The Bahamas', 'Florida', 'Georgia', 'The Carolinas', 'Virginia'], ['Southeastern United States', 'Northeastern United States', 'Southwestern Quebec'], ['Bermuda', 'New England', 'Atlantic Canada'], ['Lesser Antilles', 'Central America'], ['Texas', 'Louisiana', 'Midwestern United States'], ['Central America'], ['The Caribbean', 'Mexico', 'Texas'], ['Cuba', 'United States Gulf Coast'], ['The Caribbean', 'Central America', 'Mexico', 'United States Gulf Coast'], ['Mexico'], ['The Caribbean', 'United States East coast'], ['The Caribbean', 'Yucatn Peninsula', 'Mexico', 'South Texas'], ['Jamaica', 'Venezuela', 'Central America', 'Hispaniola', 'Mexico'], ['The Caribbean', 'United States East Coast'], ['The Bahamas', 'Florida', 'United States Gulf Coast'], ['Central America', 'Yucatn Peninsula', 'South Florida'], ['Greater Antilles', 'Bahamas', 'Eastern United States', 'Ontario'], ['The Caribbean', 'Venezuela', 'United States Gulf Coast'], ['Windward Islands', 'Jamaica', 'Mexico', 'Texas'], ['Bahamas', 'United States Gulf Coast'], ['Cuba', 'United States Gulf Coast'], ['Greater Antilles', 'Central America', 'Florida'], ['The Caribbean', 'Central America'], ['Nicaragua', 'Honduras'], ['Antilles', 'Venezuela', 'Colombia', 'United States East Coast', 'Atlantic Canada'], ['Cape Verde', 'The Caribbean', 'British Virgin Islands', 'U.S. Virgin Islands', 'Cuba', 'Florida'], ['Lesser Antilles', 'Virgin Islands', 'Puerto Rico', 'Dominican Republic', 'Turks and Caicos Islands'], ['Central America', 'United States Gulf Coast (especially Florida Panhandle)']] # damages (USD($)) of hurricanes damages = ['Damages not recorded', '100M', 'Damages not recorded', '40M', '27.9M', '5M', 'Damages not recorded', '306M', '2M', '65.8M', '326M', '60.3M', '208M', '1.42B', '25.4M', 'Damages not recorded', '1.54B', '1.24B', '7.1B', '10B', '26.5B', '6.2B', '5.37B', '23.3B', '1.01B', '125B', '12B', '29.4B', '1.76B', '720M', '15.1B', '64.8B', '91.6B', '25.1B'] # deaths for each hurricane deaths = [90,4000,16,3103,179,184,408,682,5,1023,43,319,688,259,37,11,2068,269,318,107,65,19325,51,124,17,1836,125,87,45,133,603,138,3057,74] # 1 # Update Recorded Damages conversion = {"M": 1000000, "B": 1000000000} def convert_values(item): if item == "Damages not recorded": return "Damages not recorded" elif item[-1] == 'M': return int(float(item[:-1]) * 1000000) elif item[-1] == 'B': return int(float(item[:-1]) * 1000000000) # test function by updating damages damages = list(map(convert_values, damages)) print(damages) print("*****************************************************") # 2 # Create a Table hurricane_dictionary = {} for index in range(len(names)): hurricane_dictionary[names[index]] = {'Name': names[index], 'Month':months[index], 'Year': years[index], 'Max Sustained Wind': max_sustained_winds[index], 'Areas Affected': areas_affected[index], 'Damage': damages[index], 'Deaths': deaths[index]} print(hurricane_dictionary) print("*****************************************************") # Create and view the hurricanes dictionary new_dictionary = {} def organize_by_year(hurricanes): hurricanes_by_year= dict() for cane in hurricanes: current_year = hurricanes[cane]['Year'] current_cane = hurricanes[cane] if current_year not in hurricanes_by_year: hurricanes_by_year[current_year] = [current_cane] else: hurricanes_by_year[current_year].append(current_cane) return hurricanes_by_year hurricanes_by_year = organize_by_year(hurricane_dictionary) print(organize_by_year(hurricane_dictionary)) # 3 # Organizing by Year # create a new dictionary of hurricanes with year and key print("*****************************************************") # 4 # Counting Damaged Areas def organize_areas_by_count(hurricanes): hurricanes_by_area = dict() for cane in hurricanes: current_areas = hurricanes[cane]['Areas Affected'] for area in current_areas: if area not in hurricanes_by_area: hurricanes_by_area[area] = 1 else: hurricanes_by_area[area] += 1 return hurricanes_by_area print(organize_areas_by_count(hurricane_dictionary)) # create dictionary of areas to store the number of hurricanes involved in # 5 # Calculating Maximum Hurricane Count def find_most_affected(hurricanes): return list(organize_areas_by_count(hurricanes).items())[0] # find most frequently affected area and the number of hurricanes involved in print(find_most_affected(hurricane_dictionary)) print("*****************************************************") # 6 # Calculating the Deadliest Hurricane print(hurricane_dictionary) def find_most_deaths(hurricanes): highest_death = {'Deaths': 0} for cane in hurricanes: if hurricanes[cane].get('Deaths', 0) > int(list(highest_death.values())[0]): highest_death = {hurricanes[cane]['Name']: hurricanes[cane]['Deaths']} return highest_death # find highest mortality hurricane and the number of deaths print("The deadliest hurricane and the number of deaths: " + str(find_most_deaths(hurricane_dictionary))) # 7 # Rating Hurricanes by Mortality print("*****************************************************") def rate_by_mortality(hurricanes): new_dictionary = {0:[], 1:[], 2:[], 3:[], 4:[]} for cane in hurricanes: if hurricanes[cane]['Deaths'] == 0: new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 100: new_dictionary[1].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 500: new_dictionary[2].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 1000: new_dictionary[3].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 10000: new_dictionary[4].append(hurricanes[cane]) return new_dictionary print(rate_by_mortality(hurricane_dictionary)) # categorize hurricanes in new dictionary with mortality severity as key print("*****************************************************") # 8 Calculating Hurricane Maximum Damage def find_most_damage(hurricanes): highest_death = {'Damage': 0} for cane in hurricanes: if hurricanes[cane]['Damage'] == "Damages not recorded": continue elif hurricanes[cane]['Damage'] > int(list(highest_death.values())[0]): highest_death = {hurricanes[cane]['Name']: hurricanes[cane]['Damage']} return highest_death # find highest damage inducing hurricane and its total cost print("The most damaging hurricane and its damages: " + str(find_most_damage(hurricane_dictionary))) # 9 # Rating Hurricanes by Damage damage_scale = {0: 0, 1: 100000000, 2: 1000000000, 3: 10000000000, 4: 50000000000} print("*****************************************************") def rate_by_damages(hurricanes): new_dictionary = {0:[], 1:[], 2:[], 3:[], 4:[]} for cane in hurricanes: if hurricanes[cane]['Damage'] == 'Damages not recorded': new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] == 0: new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 100000000: new_dictionary[1].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 1000000000: new_dictionary[2].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 10000000000: new_dictionary[3].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 50000000000: new_dictionary[4].append(hurricanes[cane]) return new_dictionary print(rate_by_damages(hurricane_dictionary)) # categorize hurricanes in new dictionary with damage severity as key
names = ['Cuba I', 'San Felipe II Okeechobee', 'Bahamas', 'Cuba II', 'CubaBrownsville', 'Tampico', 'Labor Day', 'New England', 'Carol', 'Janet', 'Carla', 'Hattie', 'Beulah', 'Camille', 'Edith', 'Anita', 'David', 'Allen', 'Gilbert', 'Hugo', 'Andrew', 'Mitch', 'Isabel', 'Ivan', 'Emily', 'Katrina', 'Rita', 'Wilma', 'Dean', 'Felix', 'Matthew', 'Irma', 'Maria', 'Michael'] months = ['October', 'September', 'September', 'November', 'August', 'September', 'September', 'September', 'September', 'September', 'September', 'October', 'September', 'August', 'September', 'September', 'August', 'August', 'September', 'September', 'August', 'October', 'September', 'September', 'July', 'August', 'September', 'October', 'August', 'September', 'October', 'September', 'September', 'October'] years = [1924, 1928, 1932, 1932, 1933, 1933, 1935, 1938, 1953, 1955, 1961, 1961, 1967, 1969, 1971, 1977, 1979, 1980, 1988, 1989, 1992, 1998, 2003, 2004, 2005, 2005, 2005, 2005, 2007, 2007, 2016, 2017, 2017, 2018] max_sustained_winds = [165, 160, 160, 175, 160, 160, 185, 160, 160, 175, 175, 160, 160, 175, 160, 175, 175, 190, 185, 160, 175, 180, 165, 165, 160, 175, 180, 185, 175, 175, 165, 180, 175, 160] areas_affected = [['Central America', 'Mexico', 'Cuba', 'Florida', 'The Bahamas'], ['Lesser Antilles', 'The Bahamas', 'United States East Coast', 'Atlantic Canada'], ['The Bahamas', 'Northeastern United States'], ['Lesser Antilles', 'Jamaica', 'Cayman Islands', 'Cuba', 'The Bahamas', 'Bermuda'], ['The Bahamas', 'Cuba', 'Florida', 'Texas', 'Tamaulipas'], ['Jamaica', 'Yucatn Peninsula'], ['The Bahamas', 'Florida', 'Georgia', 'The Carolinas', 'Virginia'], ['Southeastern United States', 'Northeastern United States', 'Southwestern Quebec'], ['Bermuda', 'New England', 'Atlantic Canada'], ['Lesser Antilles', 'Central America'], ['Texas', 'Louisiana', 'Midwestern United States'], ['Central America'], ['The Caribbean', 'Mexico', 'Texas'], ['Cuba', 'United States Gulf Coast'], ['The Caribbean', 'Central America', 'Mexico', 'United States Gulf Coast'], ['Mexico'], ['The Caribbean', 'United States East coast'], ['The Caribbean', 'Yucatn Peninsula', 'Mexico', 'South Texas'], ['Jamaica', 'Venezuela', 'Central America', 'Hispaniola', 'Mexico'], ['The Caribbean', 'United States East Coast'], ['The Bahamas', 'Florida', 'United States Gulf Coast'], ['Central America', 'Yucatn Peninsula', 'South Florida'], ['Greater Antilles', 'Bahamas', 'Eastern United States', 'Ontario'], ['The Caribbean', 'Venezuela', 'United States Gulf Coast'], ['Windward Islands', 'Jamaica', 'Mexico', 'Texas'], ['Bahamas', 'United States Gulf Coast'], ['Cuba', 'United States Gulf Coast'], ['Greater Antilles', 'Central America', 'Florida'], ['The Caribbean', 'Central America'], ['Nicaragua', 'Honduras'], ['Antilles', 'Venezuela', 'Colombia', 'United States East Coast', 'Atlantic Canada'], ['Cape Verde', 'The Caribbean', 'British Virgin Islands', 'U.S. Virgin Islands', 'Cuba', 'Florida'], ['Lesser Antilles', 'Virgin Islands', 'Puerto Rico', 'Dominican Republic', 'Turks and Caicos Islands'], ['Central America', 'United States Gulf Coast (especially Florida Panhandle)']] damages = ['Damages not recorded', '100M', 'Damages not recorded', '40M', '27.9M', '5M', 'Damages not recorded', '306M', '2M', '65.8M', '326M', '60.3M', '208M', '1.42B', '25.4M', 'Damages not recorded', '1.54B', '1.24B', '7.1B', '10B', '26.5B', '6.2B', '5.37B', '23.3B', '1.01B', '125B', '12B', '29.4B', '1.76B', '720M', '15.1B', '64.8B', '91.6B', '25.1B'] deaths = [90, 4000, 16, 3103, 179, 184, 408, 682, 5, 1023, 43, 319, 688, 259, 37, 11, 2068, 269, 318, 107, 65, 19325, 51, 124, 17, 1836, 125, 87, 45, 133, 603, 138, 3057, 74] conversion = {'M': 1000000, 'B': 1000000000} def convert_values(item): if item == 'Damages not recorded': return 'Damages not recorded' elif item[-1] == 'M': return int(float(item[:-1]) * 1000000) elif item[-1] == 'B': return int(float(item[:-1]) * 1000000000) damages = list(map(convert_values, damages)) print(damages) print('*****************************************************') hurricane_dictionary = {} for index in range(len(names)): hurricane_dictionary[names[index]] = {'Name': names[index], 'Month': months[index], 'Year': years[index], 'Max Sustained Wind': max_sustained_winds[index], 'Areas Affected': areas_affected[index], 'Damage': damages[index], 'Deaths': deaths[index]} print(hurricane_dictionary) print('*****************************************************') new_dictionary = {} def organize_by_year(hurricanes): hurricanes_by_year = dict() for cane in hurricanes: current_year = hurricanes[cane]['Year'] current_cane = hurricanes[cane] if current_year not in hurricanes_by_year: hurricanes_by_year[current_year] = [current_cane] else: hurricanes_by_year[current_year].append(current_cane) return hurricanes_by_year hurricanes_by_year = organize_by_year(hurricane_dictionary) print(organize_by_year(hurricane_dictionary)) print('*****************************************************') def organize_areas_by_count(hurricanes): hurricanes_by_area = dict() for cane in hurricanes: current_areas = hurricanes[cane]['Areas Affected'] for area in current_areas: if area not in hurricanes_by_area: hurricanes_by_area[area] = 1 else: hurricanes_by_area[area] += 1 return hurricanes_by_area print(organize_areas_by_count(hurricane_dictionary)) def find_most_affected(hurricanes): return list(organize_areas_by_count(hurricanes).items())[0] print(find_most_affected(hurricane_dictionary)) print('*****************************************************') print(hurricane_dictionary) def find_most_deaths(hurricanes): highest_death = {'Deaths': 0} for cane in hurricanes: if hurricanes[cane].get('Deaths', 0) > int(list(highest_death.values())[0]): highest_death = {hurricanes[cane]['Name']: hurricanes[cane]['Deaths']} return highest_death print('The deadliest hurricane and the number of deaths: ' + str(find_most_deaths(hurricane_dictionary))) print('*****************************************************') def rate_by_mortality(hurricanes): new_dictionary = {0: [], 1: [], 2: [], 3: [], 4: []} for cane in hurricanes: if hurricanes[cane]['Deaths'] == 0: new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 100: new_dictionary[1].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 500: new_dictionary[2].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 1000: new_dictionary[3].append(hurricanes[cane]) elif hurricanes[cane]['Deaths'] <= 10000: new_dictionary[4].append(hurricanes[cane]) return new_dictionary print(rate_by_mortality(hurricane_dictionary)) print('*****************************************************') def find_most_damage(hurricanes): highest_death = {'Damage': 0} for cane in hurricanes: if hurricanes[cane]['Damage'] == 'Damages not recorded': continue elif hurricanes[cane]['Damage'] > int(list(highest_death.values())[0]): highest_death = {hurricanes[cane]['Name']: hurricanes[cane]['Damage']} return highest_death print('The most damaging hurricane and its damages: ' + str(find_most_damage(hurricane_dictionary))) damage_scale = {0: 0, 1: 100000000, 2: 1000000000, 3: 10000000000, 4: 50000000000} print('*****************************************************') def rate_by_damages(hurricanes): new_dictionary = {0: [], 1: [], 2: [], 3: [], 4: []} for cane in hurricanes: if hurricanes[cane]['Damage'] == 'Damages not recorded': new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] == 0: new_dictionary[0].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 100000000: new_dictionary[1].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 1000000000: new_dictionary[2].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 10000000000: new_dictionary[3].append(hurricanes[cane]) elif hurricanes[cane]['Damage'] <= 50000000000: new_dictionary[4].append(hurricanes[cane]) return new_dictionary print(rate_by_damages(hurricane_dictionary))
alien_0 = {'color': 'green', 'points': 5} alien_1 = {'color': 'yellow', 'points': 10} alien_2 = {'color': 'red', 'points': 15} aliens = [alien_0, alien_1, alien_2] for alien in aliens: print(alien) print('...') aliens = [] for alien_number in range(30): new_alien = {'color': 'green', 'points': 5, 'speed': 'slow'} aliens.append(new_alien) for alien in aliens[:3]: if alien['color'] == 'green': alien['color'] = 'yellow' alien['poins'] = 10 alien['speed'] = 'medium' elif alien['color'] == 'yellow': alien['color'] = 'red' alien['poins'] = 15 alien['speed'] = 'fast' for alien in aliens[:5]: print(alien) print('...') print('Total number of aliens: ' + str(len(aliens)))
alien_0 = {'color': 'green', 'points': 5} alien_1 = {'color': 'yellow', 'points': 10} alien_2 = {'color': 'red', 'points': 15} aliens = [alien_0, alien_1, alien_2] for alien in aliens: print(alien) print('...') aliens = [] for alien_number in range(30): new_alien = {'color': 'green', 'points': 5, 'speed': 'slow'} aliens.append(new_alien) for alien in aliens[:3]: if alien['color'] == 'green': alien['color'] = 'yellow' alien['poins'] = 10 alien['speed'] = 'medium' elif alien['color'] == 'yellow': alien['color'] = 'red' alien['poins'] = 15 alien['speed'] = 'fast' for alien in aliens[:5]: print(alien) print('...') print('Total number of aliens: ' + str(len(aliens)))
#!/usr/bin/env python3 with open("day-1/data") as f: expenses = f.readlines() founditems = [] def accounting(i): for j in expenses: j = int(j.strip('\n')) for x in expenses: x = int(x.strip('\n')) if i + j + x == 2020 and i * j * x not in founditems: print("3-sum: " + str(i * j * x)) founditems.append(i * j * x) if i + j == 2020 and i * j not in founditems: print("2-sum: " + str(i * j)) founditems.append(i * j) for i in expenses: i = int(i.strip('\n')) accounting(i = i)
with open('day-1/data') as f: expenses = f.readlines() founditems = [] def accounting(i): for j in expenses: j = int(j.strip('\n')) for x in expenses: x = int(x.strip('\n')) if i + j + x == 2020 and i * j * x not in founditems: print('3-sum: ' + str(i * j * x)) founditems.append(i * j * x) if i + j == 2020 and i * j not in founditems: print('2-sum: ' + str(i * j)) founditems.append(i * j) for i in expenses: i = int(i.strip('\n')) accounting(i=i)
class Command(object): CONTINUE = 1 SKIP_REMAINING = 2 def __init__(self, args=None, explicit=False): self.explicit = explicit self._args = args or [] @property def args(self): return self._args def add_argument(self, arg): self._args.append(arg) def cmdline(self): return [self.name] + self._args def check_result(self, result): return Command.CONTINUE def __repr__(self): return "Command(name={}, args={})".format(self.name, self._args) class SynchronizeCommand(Command): name = "synchronize" class DeployCommand(Command): # Flag constants for deploy return value REPO_UNCHANGED = "repo_unchanged" REPO_CHANGED = "repo_changed" name = "deploy" def check_result(self, result): # For backwards compatibility if not result: return Command.CONTINUE changed = any(result[v] == DeployCommand.REPO_CHANGED for v in result) if not changed: return Command.SKIP_REMAINING else: return Command.CONTINUE class BuildCommand(Command): name = "build" class RestartCommand(Command): name = "restart" class WaitUntilComponentsReadyCommand(Command): name = "wait-until-components-ready" class GenericCommand(Command): def __init__(self, name, args=None): self.name = name # Generic commands can only be added explicitly from the commandline. super(GenericCommand, self).__init__(args=args, explicit=True)
class Command(object): continue = 1 skip_remaining = 2 def __init__(self, args=None, explicit=False): self.explicit = explicit self._args = args or [] @property def args(self): return self._args def add_argument(self, arg): self._args.append(arg) def cmdline(self): return [self.name] + self._args def check_result(self, result): return Command.CONTINUE def __repr__(self): return 'Command(name={}, args={})'.format(self.name, self._args) class Synchronizecommand(Command): name = 'synchronize' class Deploycommand(Command): repo_unchanged = 'repo_unchanged' repo_changed = 'repo_changed' name = 'deploy' def check_result(self, result): if not result: return Command.CONTINUE changed = any((result[v] == DeployCommand.REPO_CHANGED for v in result)) if not changed: return Command.SKIP_REMAINING else: return Command.CONTINUE class Buildcommand(Command): name = 'build' class Restartcommand(Command): name = 'restart' class Waituntilcomponentsreadycommand(Command): name = 'wait-until-components-ready' class Genericcommand(Command): def __init__(self, name, args=None): self.name = name super(GenericCommand, self).__init__(args=args, explicit=True)
Desc = cellDescClass("DFFNSRX4") Desc.properties["cell_footprint"] = "dffnsr" Desc.properties["area"] = "116.424000" Desc.properties["cell_leakage_power"] = "3723.759540" Desc.pinOrder = ['CKN', 'D', 'IQ', 'IQN', 'Q', 'QN', 'RN', 'SN', 'next'] Desc.add_arc("CKN","D","setup_falling") Desc.add_arc("CKN","D","hold_falling") Desc.add_arc("CKN","SN","setup_falling") Desc.add_arc("CKN","SN","hold_falling") Desc.add_arc("CKN","RN","setup_falling") Desc.add_arc("CKN","RN","hold_falling") Desc.add_arc("CKN","Q","falling_edge") Desc.add_arc("SN","Q","preset") Desc.add_arc("RN","Q","clear") Desc.add_arc("CKN","QN","falling_edge") Desc.add_arc("SN","QN","clear") Desc.add_arc("RN","QN","preset") Desc.add_param("area",116.424000); Desc.add_pin("D","input") Desc.set_pin_job("CKN","clock") Desc.add_pin("CKN","input") Desc.add_pin("SN","input") Desc.add_pin("RN","input") Desc.add_pin("Q","output") Desc.add_pin_func("Q","unknown") Desc.add_pin("QN","output") Desc.add_pin_func("QN","unknown") Desc.add_pin("IQ","output") Desc.add_pin_func("IQ","unknown") Desc.add_pin("IQN","output") Desc.add_pin_func("IQN","unknown") Desc.add_pin("next","output") Desc.add_pin_func("next","unknown") Desc.set_job("flipflop") CellLib["DFFNSRX4"]=Desc
desc = cell_desc_class('DFFNSRX4') Desc.properties['cell_footprint'] = 'dffnsr' Desc.properties['area'] = '116.424000' Desc.properties['cell_leakage_power'] = '3723.759540' Desc.pinOrder = ['CKN', 'D', 'IQ', 'IQN', 'Q', 'QN', 'RN', 'SN', 'next'] Desc.add_arc('CKN', 'D', 'setup_falling') Desc.add_arc('CKN', 'D', 'hold_falling') Desc.add_arc('CKN', 'SN', 'setup_falling') Desc.add_arc('CKN', 'SN', 'hold_falling') Desc.add_arc('CKN', 'RN', 'setup_falling') Desc.add_arc('CKN', 'RN', 'hold_falling') Desc.add_arc('CKN', 'Q', 'falling_edge') Desc.add_arc('SN', 'Q', 'preset') Desc.add_arc('RN', 'Q', 'clear') Desc.add_arc('CKN', 'QN', 'falling_edge') Desc.add_arc('SN', 'QN', 'clear') Desc.add_arc('RN', 'QN', 'preset') Desc.add_param('area', 116.424) Desc.add_pin('D', 'input') Desc.set_pin_job('CKN', 'clock') Desc.add_pin('CKN', 'input') Desc.add_pin('SN', 'input') Desc.add_pin('RN', 'input') Desc.add_pin('Q', 'output') Desc.add_pin_func('Q', 'unknown') Desc.add_pin('QN', 'output') Desc.add_pin_func('QN', 'unknown') Desc.add_pin('IQ', 'output') Desc.add_pin_func('IQ', 'unknown') Desc.add_pin('IQN', 'output') Desc.add_pin_func('IQN', 'unknown') Desc.add_pin('next', 'output') Desc.add_pin_func('next', 'unknown') Desc.set_job('flipflop') CellLib['DFFNSRX4'] = Desc
def _is_socket(path): # -S if not path: return False if hasattr(path, '_mode'): return stat.S_ISSOCK(path._mode) if hasattr(path, 'fileno') and os.stat in os.supports_fd: path = path.fileno() elif hasattr(path, 'name'): path = path.name return stat.S_ISSOCK(os.stat(path).st_mode)
def _is_socket(path): if not path: return False if hasattr(path, '_mode'): return stat.S_ISSOCK(path._mode) if hasattr(path, 'fileno') and os.stat in os.supports_fd: path = path.fileno() elif hasattr(path, 'name'): path = path.name return stat.S_ISSOCK(os.stat(path).st_mode)
num1 = 10 num2 = int(input()) def add_sum(): sum = num1+num2 print(sum) add_sum()
num1 = 10 num2 = int(input()) def add_sum(): sum = num1 + num2 print(sum) add_sum()
class ConsoleCommandFailed(Exception): pass class ConvergeFailed(Exception): pass
class Consolecommandfailed(Exception): pass class Convergefailed(Exception): pass
class Overflow( Enum, CascadeProperty, ): Visible = "visible" # initial Hidden = "hidden" Scroll = "scroll" Auto = "auto"
class Overflow(Enum, CascadeProperty): visible = 'visible' hidden = 'hidden' scroll = 'scroll' auto = 'auto'
def Y_S(a): if a == 0: return 0 else: ys = (a//30) * 10 + 10 return ys def M_S(b): if b == 0: return 0 else: ms = (b//60) * 15 + 15 return ms N=int(input()) ms_add = 0 ys_add = 0 arr = list(map(int,input().split())) for i in arr: Y = Y_S(i) M = M_S(i) ys_add += Y ms_add += M if ys_add < ms_add: print('Y',ys_add) elif ys_add == ms_add: print('Y M',ys_add) else: print('M',ms_add)
def y_s(a): if a == 0: return 0 else: ys = a // 30 * 10 + 10 return ys def m_s(b): if b == 0: return 0 else: ms = b // 60 * 15 + 15 return ms n = int(input()) ms_add = 0 ys_add = 0 arr = list(map(int, input().split())) for i in arr: y = y_s(i) m = m_s(i) ys_add += Y ms_add += M if ys_add < ms_add: print('Y', ys_add) elif ys_add == ms_add: print('Y M', ys_add) else: print('M', ms_add)
animals = ['bear', 'python3.8', 'peacock', 'kangaroo', 'whale', 'platypus'] print("The animal at 1: ", animals[1]) # Python3.8 print("The third animal: ", animals[2]) # Peacock print("The first animal: ", animals[0]) # bear print("The animal at 3: ", animals[3]) # kangaroo print("The fifth (5th) animal: ", animals[4]) # whale print("The animal at 2: ", animals[2]) # peacock print("The sixth (6th) animal: ", animals[5]) # platypus print("The animal at 4: ", animals[4]) # whale
animals = ['bear', 'python3.8', 'peacock', 'kangaroo', 'whale', 'platypus'] print('The animal at 1: ', animals[1]) print('The third animal: ', animals[2]) print('The first animal: ', animals[0]) print('The animal at 3: ', animals[3]) print('The fifth (5th) animal: ', animals[4]) print('The animal at 2: ', animals[2]) print('The sixth (6th) animal: ', animals[5]) print('The animal at 4: ', animals[4])
class User: def __init__(self, reddit_id, username, karma, relevant_comments, relevant_posts): self.reddit_id = reddit_id self.username = username self.karma = karma self.score = 0 self.relevant_comments = relevant_comments self.relevant_posts = relevant_posts
class User: def __init__(self, reddit_id, username, karma, relevant_comments, relevant_posts): self.reddit_id = reddit_id self.username = username self.karma = karma self.score = 0 self.relevant_comments = relevant_comments self.relevant_posts = relevant_posts
# Mathematics > Algebra > Little Gaurav and Sequence # Help Gaurav in calculating last digit of a sequence. # # https://www.hackerrank.com/challenges/little-gaurav-and-sequence/problem # def S_brutforce(n): s = 0 i = 0 while 2 ** i <= n: for j in range(0, n + 1): s += 2 ** (2 ** i + 2 * j) i += 1 return s def S(n): # s1 = 0 # i = 0 # while 2 ** i <= n: # s1 += 2 ** (2 ** i) # i += 1 i = n k = 0 while i != 0: i //= 2 k += 1 if k == 1: s1 = 2 else: s1 = [6, 2, 8, 4, 0][(k - 2) % 5] # s2 = (4 ** (n + 1) - 1) // (4 - 1) # s2 = 1 mod 10 si n pair # s2 = 5 mod 10 si n impair s2 = 1 if n % 2 == 0 else 5 return (s1 * s2) % 10 def test(): for n in range(1, 100): s = S(n) assert (s % 10) == (S_brutforce(n) % 10) print("{:4} {}".format(n, s % 10)) for _ in range(int(input())): n = int(input()) if n % 2 == 1: print(0) else: s = S(n) print(s)
def s_brutforce(n): s = 0 i = 0 while 2 ** i <= n: for j in range(0, n + 1): s += 2 ** (2 ** i + 2 * j) i += 1 return s def s(n): i = n k = 0 while i != 0: i //= 2 k += 1 if k == 1: s1 = 2 else: s1 = [6, 2, 8, 4, 0][(k - 2) % 5] s2 = 1 if n % 2 == 0 else 5 return s1 * s2 % 10 def test(): for n in range(1, 100): s = s(n) assert s % 10 == s_brutforce(n) % 10 print('{:4} {}'.format(n, s % 10)) for _ in range(int(input())): n = int(input()) if n % 2 == 1: print(0) else: s = s(n) print(s)
# Solution to Mega Contest 1 Problem: Maximum Sum for testcase in range(int(input())): n, k = map(int, input().split()) array_a = list(map(int, input().split())) array_b = list(map(int, input().split())) if k>0: array_a.sort() array_b.sort() # max_sum = sum(array_a[k:]+array_b[n-k:]) values = array_a[k:] for val in range(k): values.append(max(array_a[val], array_b[-val-1])) max_sum = sum(values) else: max_sum = sum(array_a) print(max_sum)
for testcase in range(int(input())): (n, k) = map(int, input().split()) array_a = list(map(int, input().split())) array_b = list(map(int, input().split())) if k > 0: array_a.sort() array_b.sort() values = array_a[k:] for val in range(k): values.append(max(array_a[val], array_b[-val - 1])) max_sum = sum(values) else: max_sum = sum(array_a) print(max_sum)
N = int(input()) V = list(map(int, input().split())) C = list(map(int, input().split())) result = 0 for i in range(N): if V[i] > C[i]: result += V[i] - C[i] print(result)
n = int(input()) v = list(map(int, input().split())) c = list(map(int, input().split())) result = 0 for i in range(N): if V[i] > C[i]: result += V[i] - C[i] print(result)
class Hair(object): def __init__(self, radius): self.radius = radius self.phi = random(TAU) self.slow = random(1.15, 1.2) self.theta = asin(random(-self.radius, self.radius) / self.radius) self.z = self.radius * sin(self.theta) def render(self): oFF = (noise(millis() * 0.0005, sin(self.phi)) - 0.5) * 0.3 oFFb = (noise(millis() * 0.0007, sin(self.z) * 0.01) - 0.5) * 0.3 self.thetaFF = self.theta + oFF phiFF = self.phi + oFFb x = self.radius * cos(self.theta) * cos(self.phi) y = self.radius * cos(self.theta) * sin(self.phi) self.z = self.radius * sin(self.theta) xo = self.radius * cos(self.thetaFF) * cos(phiFF) yo = self.radius * cos(self.thetaFF) * sin(phiFF) zo = self.radius * sin(self.thetaFF) xb = xo * self.slow yb = yo * self.slow zb = zo * self.slow with beginShape(LINES): stroke(0) vertex(x, y, self.z) stroke(200, 150) vertex(xb, yb, zb)
class Hair(object): def __init__(self, radius): self.radius = radius self.phi = random(TAU) self.slow = random(1.15, 1.2) self.theta = asin(random(-self.radius, self.radius) / self.radius) self.z = self.radius * sin(self.theta) def render(self): o_ff = (noise(millis() * 0.0005, sin(self.phi)) - 0.5) * 0.3 o_f_fb = (noise(millis() * 0.0007, sin(self.z) * 0.01) - 0.5) * 0.3 self.thetaFF = self.theta + oFF phi_ff = self.phi + oFFb x = self.radius * cos(self.theta) * cos(self.phi) y = self.radius * cos(self.theta) * sin(self.phi) self.z = self.radius * sin(self.theta) xo = self.radius * cos(self.thetaFF) * cos(phiFF) yo = self.radius * cos(self.thetaFF) * sin(phiFF) zo = self.radius * sin(self.thetaFF) xb = xo * self.slow yb = yo * self.slow zb = zo * self.slow with begin_shape(LINES): stroke(0) vertex(x, y, self.z) stroke(200, 150) vertex(xb, yb, zb)
with open("input.txt") as f: numbers = list(map(int, f.readline().split())) def parse_tree_metadata(tree): num_nodes = tree[0] num_metadata = tree[1] leafs = tree[2:] total = 0 for i in range(num_nodes): leafs, sum_metadata = parse_tree_metadata(leafs) total += sum_metadata for i in range(num_metadata): total += leafs[i] return leafs[num_metadata:], total print(parse_tree_metadata(numbers)[1]) def get_value_root_node(start): node_sum = 0 num_nodes, num_metadata = numbers[start : start + 2] next_start = start + 2 if num_nodes: node_values = [] for child_node in range(num_nodes): temporary_sum, next_start = get_value_root_node(next_start) node_values.append(temporary_sum) for i in numbers[next_start : next_start + num_metadata]: if i - 1 < len(node_values): node_sum += node_values[i - 1] else: node_sum += sum(numbers[next_start : next_start + num_metadata]) return node_sum, next_start + num_metadata print(get_value_root_node(0)[0])
with open('input.txt') as f: numbers = list(map(int, f.readline().split())) def parse_tree_metadata(tree): num_nodes = tree[0] num_metadata = tree[1] leafs = tree[2:] total = 0 for i in range(num_nodes): (leafs, sum_metadata) = parse_tree_metadata(leafs) total += sum_metadata for i in range(num_metadata): total += leafs[i] return (leafs[num_metadata:], total) print(parse_tree_metadata(numbers)[1]) def get_value_root_node(start): node_sum = 0 (num_nodes, num_metadata) = numbers[start:start + 2] next_start = start + 2 if num_nodes: node_values = [] for child_node in range(num_nodes): (temporary_sum, next_start) = get_value_root_node(next_start) node_values.append(temporary_sum) for i in numbers[next_start:next_start + num_metadata]: if i - 1 < len(node_values): node_sum += node_values[i - 1] else: node_sum += sum(numbers[next_start:next_start + num_metadata]) return (node_sum, next_start + num_metadata) print(get_value_root_node(0)[0])
class Dough: def __init__(self, flour_type, baking_technique, weight): self.__flour_type = flour_type self.__baking_technique = baking_technique self.__weight = weight @property def flour_type(self): return self.__flour_type @flour_type.setter def flour_type(self, value): self.__flour_type = value @property def baking_technique(self): return self.__baking_technique @baking_technique.setter def baking_technique(self, value): self.__baking_technique = value @property def weight(self): return self.__weight @weight.setter def weight(self, value): self.__weight = value
class Dough: def __init__(self, flour_type, baking_technique, weight): self.__flour_type = flour_type self.__baking_technique = baking_technique self.__weight = weight @property def flour_type(self): return self.__flour_type @flour_type.setter def flour_type(self, value): self.__flour_type = value @property def baking_technique(self): return self.__baking_technique @baking_technique.setter def baking_technique(self, value): self.__baking_technique = value @property def weight(self): return self.__weight @weight.setter def weight(self, value): self.__weight = value
a, b = 10, 5 print("Add: a+b = ", a+b) print("Sub: a-b = ", a-b) print("Mul: a*b = ", a*b) print("Div: a/b = ", a/b) print("Mod: a%b = ", a%b) print("Exp: a**b = ", a**b) print("Floored Div: a//b = ", a//b)
(a, b) = (10, 5) print('Add: a+b = ', a + b) print('Sub: a-b = ', a - b) print('Mul: a*b = ', a * b) print('Div: a/b = ', a / b) print('Mod: a%b = ', a % b) print('Exp: a**b = ', a ** b) print('Floored Div: a//b = ', a // b)
''' 189. Rotate Array Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4] Example 2: Input: [-1,-100,3,99] and k = 2 Output: [3,99,-1,-100] Explanation: rotate 1 steps to the right: [99,-1,-100,3] rotate 2 steps to the right: [3,99,-1,-100] Note: Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem. Could you do it in-place with O(1) extra space? ''' # Brute Force Approach - O(n*k) time, O(1) space def rotate(self, nums, k): temp, previous = 0, 0 for i in range(k): previous = nums[-1] for j in range(len(nums)): temp = nums[j] nums[j] = previous previous = temp # Using Extra Array - O(n) time, O(n) space def rotate(self, nums, k): temp = [] for i in range(len(nums)): temp.append(nums[(i + k + 1) % len(nums)]) return temp[:] # Reverse Solution - O(n) time, O(1) space def rotate(self, nums, k): if k % len(nums) != 0: k = k % len(nums) nums[:] = nums[::-1][:k][::-1] + nums[::-1][k:][::-1]
""" 189. Rotate Array Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4] Example 2: Input: [-1,-100,3,99] and k = 2 Output: [3,99,-1,-100] Explanation: rotate 1 steps to the right: [99,-1,-100,3] rotate 2 steps to the right: [3,99,-1,-100] Note: Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem. Could you do it in-place with O(1) extra space? """ def rotate(self, nums, k): (temp, previous) = (0, 0) for i in range(k): previous = nums[-1] for j in range(len(nums)): temp = nums[j] nums[j] = previous previous = temp def rotate(self, nums, k): temp = [] for i in range(len(nums)): temp.append(nums[(i + k + 1) % len(nums)]) return temp[:] def rotate(self, nums, k): if k % len(nums) != 0: k = k % len(nums) nums[:] = nums[::-1][:k][::-1] + nums[::-1][k:][::-1]
# Definition for a undirected graph node # class UndirectedGraphNode: # def __init__(self, x): # self.label = x # self.neighbors = [] class Solution: # @param node, a undirected graph node # @return a undirected graph node def cloneGraph(self, node): graph = {} visited = set() def dfs(node, visited, graph): if not node or node.label in visited: return visited |= {node.label} if node.label not in graph: graph[node.label] = UndirectedGraphNode(node.label) newNode = graph[node.label] for nbr in node.neighbors: if nbr.label not in graph: graph[nbr.label] = UndirectedGraphNode(nbr.label) newNode.neighbors.append(graph[nbr.label]) dfs(nbr, visited, graph) return newNode return dfs(node, visited, graph)
class Solution: def clone_graph(self, node): graph = {} visited = set() def dfs(node, visited, graph): if not node or node.label in visited: return visited |= {node.label} if node.label not in graph: graph[node.label] = undirected_graph_node(node.label) new_node = graph[node.label] for nbr in node.neighbors: if nbr.label not in graph: graph[nbr.label] = undirected_graph_node(nbr.label) newNode.neighbors.append(graph[nbr.label]) dfs(nbr, visited, graph) return newNode return dfs(node, visited, graph)
#Assignment 1 print("welcome to the Controlroom of Hyderabad ATC") Altitude = 1500 if Altitude <= 1000: print('youre safe to land') elif Altitude <=5000: print('Please Bring Down Altitude to 1000') else : print('it is Danger now to land, please Turn around') #Assignment2 for num in range(0,200): if num > 1: for i in range(2,num): if (num % i)== 0: break else : print(num)
print('welcome to the Controlroom of Hyderabad ATC') altitude = 1500 if Altitude <= 1000: print('youre safe to land') elif Altitude <= 5000: print('Please Bring Down Altitude to 1000') else: print('it is Danger now to land, please Turn around') for num in range(0, 200): if num > 1: for i in range(2, num): if num % i == 0: break else: print(num)
s="2 3 4 5 66 74 33 2 3" s=s.split() s = [int(x) for x in s] s1=[] for i in s: if i not in s1: s1.append(i) s1 = sorted(s1) print(s1) for i in s1: print(i,s.count(i))
s = '2 3 4 5 66 74 33 2 3' s = s.split() s = [int(x) for x in s] s1 = [] for i in s: if i not in s1: s1.append(i) s1 = sorted(s1) print(s1) for i in s1: print(i, s.count(i))
print('This is the dummy Controller') def dummy_example(): print('This is a function in the dummy Controller') if __name__ == '__main__': print('This is printed only from __main__') dummy_example()
print('This is the dummy Controller') def dummy_example(): print('This is a function in the dummy Controller') if __name__ == '__main__': print('This is printed only from __main__') dummy_example()
# Linked list operations in Python # Create a node class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None # Insert at the beginning def insertAtBeginning(self, new_data): new_node = Node(new_data) new_node.next = self.head self.head = new_node # Insert after a node def insertAfter(self, prev_node, new_data): if prev_node is None: print("The given previous node must inLinkedList.") return new_node = Node(new_data) new_node.next = prev_node.next prev_node.next = new_node # Insert at the end def insertAtEnd(self, new_data): new_node = Node(new_data) if self.head is None: self.head = new_node return last = self.head while last.next: last = last.next last.next = new_node # Deleting a node def deleteNode(self, position): if self.head is None: return temp = self.head if position == 0: self.head = temp.next temp = None return # Find the key to be deleted for i in range(position - 1): temp = temp.next if temp is None: break # If the key is not present if temp is None: return if temp.next is None: return next = temp.next.next temp.next = None temp.next = next # Search an element def search(self, key): current = self.head while current is not None: if current.data == key: return True current = current.next return False # Sort the linked list def sortLinkedList(self, head): current = head index = Node(None) if head is None: return else: while current is not None: # index points to the node next to current index = current.next while index is not None: if current.data > index.data: current.data, index.data = index.data, current.data index = index.next current = current.next # Print the linked list def printList(self): temp = self.head while temp: print(str(temp.data) + " ", end="") temp = temp.next if __name__ == "__main__": llist = LinkedList() llist.insertAtEnd(1) llist.insertAtBeginning(2) llist.insertAtBeginning(3) llist.insertAtEnd(4) llist.insertAfter(llist.head.next, 5) print("linked list:") llist.printList() print("\nAfter deleting an element:") llist.deleteNode(3) llist.printList() print() item_to_find = 3 if llist.search(item_to_find): print(str(item_to_find) + " is found") else: print(str(item_to_find) + " is not found") llist.sortLinkedList(llist.head) print("Sorted List: ") llist.printList()
class Node: def __init__(self, data): self.data = data self.next = None class Linkedlist: def __init__(self): self.head = None def insert_at_beginning(self, new_data): new_node = node(new_data) new_node.next = self.head self.head = new_node def insert_after(self, prev_node, new_data): if prev_node is None: print('The given previous node must inLinkedList.') return new_node = node(new_data) new_node.next = prev_node.next prev_node.next = new_node def insert_at_end(self, new_data): new_node = node(new_data) if self.head is None: self.head = new_node return last = self.head while last.next: last = last.next last.next = new_node def delete_node(self, position): if self.head is None: return temp = self.head if position == 0: self.head = temp.next temp = None return for i in range(position - 1): temp = temp.next if temp is None: break if temp is None: return if temp.next is None: return next = temp.next.next temp.next = None temp.next = next def search(self, key): current = self.head while current is not None: if current.data == key: return True current = current.next return False def sort_linked_list(self, head): current = head index = node(None) if head is None: return else: while current is not None: index = current.next while index is not None: if current.data > index.data: (current.data, index.data) = (index.data, current.data) index = index.next current = current.next def print_list(self): temp = self.head while temp: print(str(temp.data) + ' ', end='') temp = temp.next if __name__ == '__main__': llist = linked_list() llist.insertAtEnd(1) llist.insertAtBeginning(2) llist.insertAtBeginning(3) llist.insertAtEnd(4) llist.insertAfter(llist.head.next, 5) print('linked list:') llist.printList() print('\nAfter deleting an element:') llist.deleteNode(3) llist.printList() print() item_to_find = 3 if llist.search(item_to_find): print(str(item_to_find) + ' is found') else: print(str(item_to_find) + ' is not found') llist.sortLinkedList(llist.head) print('Sorted List: ') llist.printList()
# -*- coding: utf-8 -*- class BaseCompressor(object): def __init__(self, options): self._options = options def compress(self, value): raise NotImplementedError def decompress(self, value): raise NotImplementedError
class Basecompressor(object): def __init__(self, options): self._options = options def compress(self, value): raise NotImplementedError def decompress(self, value): raise NotImplementedError
n = 10 a = [] s = [[0] * n for i in range(n)] s2 = [[0] * n for i in range(n)] for i in range(n): a.append(list(map(int, input().split()))) s[0][0] = a[0][0] s2[0][0] = a[0][0] for j in range(1, n): s[0][j] = s[0][j - 1] + a[0][j] for i in range(1, n): s[i][0] = s[i - 1][0] + a[i][0] for i in range(n): for j in range(n): if i and j: s[i][j] = max(s[i - 1][j], s[i][j - 1]) + a[i][j] for j in range(1, n): s2[0][j] = s2[0][j - 1] + a[0][j] for i in range(1, n): s2[i][0] = s2[i - 1][0] + a[i][0] for i in range(n): for j in range(n): if i and j: s2[i][j] = min(s2[i - 1][j], s2[i][j - 1]) + a[i][j] print(s[n - 1][n - 1], s2[n - 1][n - 1], sep="")
n = 10 a = [] s = [[0] * n for i in range(n)] s2 = [[0] * n for i in range(n)] for i in range(n): a.append(list(map(int, input().split()))) s[0][0] = a[0][0] s2[0][0] = a[0][0] for j in range(1, n): s[0][j] = s[0][j - 1] + a[0][j] for i in range(1, n): s[i][0] = s[i - 1][0] + a[i][0] for i in range(n): for j in range(n): if i and j: s[i][j] = max(s[i - 1][j], s[i][j - 1]) + a[i][j] for j in range(1, n): s2[0][j] = s2[0][j - 1] + a[0][j] for i in range(1, n): s2[i][0] = s2[i - 1][0] + a[i][0] for i in range(n): for j in range(n): if i and j: s2[i][j] = min(s2[i - 1][j], s2[i][j - 1]) + a[i][j] print(s[n - 1][n - 1], s2[n - 1][n - 1], sep='')
#FUNCTION TEXT def AddCharA(char,lista,z): x=0 for y in lista[0]: if y=="|": break else: x+=1 x+=1 if x==len(lista[0]): lista[0]=lista[0][:len(lista[0])-1]+char+"|" elif x==1: lista[0]=char+lista[0][:] else: lista[0]=lista[0][:x-1]+char+lista[0][x-1:] print(char) print(lista) z[0].configure(text=lista[0]) def DelChar(lista,z): if len(lista[0])!=1: x=0 for y in lista[0]: if y=="|": break else: x+=1 x+=1 print(x) if x!=1: if x==len(lista[0]): lista[0]=lista[0][:x-2]+"|" else: lista[0]=lista[0][:x-2]+"|"+lista[0][x:] print(lista) z[0].configure(text=lista[0]) def MoveD(lista,z): if len(lista[0])!=1: x=0 for y in lista[0]: if y=="|": break else: x+=1 print(x) x+=1 if x!=len(lista[0]): if x==1: lista[0]=lista[0][x]+"|"+lista[0][x+1:] else: lista[0]=lista[0][:x-1]+lista[0][x]+"|"+lista[0][x+1:] print(lista) z[0].configure(text=lista[0]) def MoveI(lista,z): print("------\n",lista) if len(lista[0])!=1: x=0 for y in lista[0]: if y=="|": break else: x+=1 x+=1 print(x) if x!=1: if x==len(lista[0]): lista[0]=lista[0][:x-2]+"|"+lista[0][x-2] else: lista[0]=lista[0][:x-2]+"|"+lista[0][x-2]+lista[0][x:] print(lista) z[0].configure(text=lista[0])
def add_char_a(char, lista, z): x = 0 for y in lista[0]: if y == '|': break else: x += 1 x += 1 if x == len(lista[0]): lista[0] = lista[0][:len(lista[0]) - 1] + char + '|' elif x == 1: lista[0] = char + lista[0][:] else: lista[0] = lista[0][:x - 1] + char + lista[0][x - 1:] print(char) print(lista) z[0].configure(text=lista[0]) def del_char(lista, z): if len(lista[0]) != 1: x = 0 for y in lista[0]: if y == '|': break else: x += 1 x += 1 print(x) if x != 1: if x == len(lista[0]): lista[0] = lista[0][:x - 2] + '|' else: lista[0] = lista[0][:x - 2] + '|' + lista[0][x:] print(lista) z[0].configure(text=lista[0]) def move_d(lista, z): if len(lista[0]) != 1: x = 0 for y in lista[0]: if y == '|': break else: x += 1 print(x) x += 1 if x != len(lista[0]): if x == 1: lista[0] = lista[0][x] + '|' + lista[0][x + 1:] else: lista[0] = lista[0][:x - 1] + lista[0][x] + '|' + lista[0][x + 1:] print(lista) z[0].configure(text=lista[0]) def move_i(lista, z): print('------\n', lista) if len(lista[0]) != 1: x = 0 for y in lista[0]: if y == '|': break else: x += 1 x += 1 print(x) if x != 1: if x == len(lista[0]): lista[0] = lista[0][:x - 2] + '|' + lista[0][x - 2] else: lista[0] = lista[0][:x - 2] + '|' + lista[0][x - 2] + lista[0][x:] print(lista) z[0].configure(text=lista[0])
_base_ = [ '../_base_/datasets/OxfordPet_bs64.py', '../_base_/default_runtime.py', '../_base_/models/resnet50.py', ] # load model pretrained on imagenet model = dict( backbone=dict( init_cfg=dict( type='Pretrained', checkpoint='https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb32_in1k_20210831-ea4938fc.pth', prefix='backbone', )), head=dict(num_classes=37), ) # optimizer optimizer = dict( type='SGD', lr=0.01, momentum=0.9, weight_decay=1e-4 ) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict(policy='CosineAnnealing', min_lr=0) runner = dict(type='EpochBasedRunner', max_epochs=60) log_config = dict( interval=10, hooks=[ dict(type='TextLoggerHook'), # dict(type='TensorboardLoggerHook') ]) checkpoint_config = dict(interval=20)
_base_ = ['../_base_/datasets/OxfordPet_bs64.py', '../_base_/default_runtime.py', '../_base_/models/resnet50.py'] model = dict(backbone=dict(init_cfg=dict(type='Pretrained', checkpoint='https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb32_in1k_20210831-ea4938fc.pth', prefix='backbone')), head=dict(num_classes=37)) optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) lr_config = dict(policy='CosineAnnealing', min_lr=0) runner = dict(type='EpochBasedRunner', max_epochs=60) log_config = dict(interval=10, hooks=[dict(type='TextLoggerHook')]) checkpoint_config = dict(interval=20)
def quick_sort(arr,low,high): if len(arr) > 1: if low < high: position = partition(arr,low,high) quick_sort(arr,low,position -1) quick_sort(arr,position +1,high) return arr return arr def partition(arr,low,high): position = low for i in range(low,high): if arr[i] < arr[high]: arr[i],arr[position] = arr[position], arr[i] position += 1 arr[position],arr[high] = arr[high],arr[position] return position
def quick_sort(arr, low, high): if len(arr) > 1: if low < high: position = partition(arr, low, high) quick_sort(arr, low, position - 1) quick_sort(arr, position + 1, high) return arr return arr def partition(arr, low, high): position = low for i in range(low, high): if arr[i] < arr[high]: (arr[i], arr[position]) = (arr[position], arr[i]) position += 1 (arr[position], arr[high]) = (arr[high], arr[position]) return position
name = 'snape' print(name+name+str(7)) age = 11 wizard_age_multiplier = 56 final_age = age * wizard_age_multiplier print(f'You are {age} which means you are {final_age} in wizard years') print('You are ' + str(age) + ' which means you are ' + str(final_age) + ' in wizard years')
name = 'snape' print(name + name + str(7)) age = 11 wizard_age_multiplier = 56 final_age = age * wizard_age_multiplier print(f'You are {age} which means you are {final_age} in wizard years') print('You are ' + str(age) + ' which means you are ' + str(final_age) + ' in wizard years')
# Python program to find the factorial of a number num = int(input("Enter a number: ")) factorial = 1 if num < 0: print("factorial does not exist for negative numbers") elif num == 0: print("The factorial of 0 is 1") else: for i in range(1, num + 1): factorial = factorial*i print("The factorial of", num, "is", factorial)
num = int(input('Enter a number: ')) factorial = 1 if num < 0: print('factorial does not exist for negative numbers') elif num == 0: print('The factorial of 0 is 1') else: for i in range(1, num + 1): factorial = factorial * i print('The factorial of', num, 'is', factorial)
class InstagramException(Exception): StatusCode = -1 def __init__(self, message="", code=500): super().__init__(f'{message}, Code:{code}') @staticmethod def default(response_text, status_code): StatusCode = status_code return InstagramException( 'Response code is {status_code}. Body: {response_text} ' 'Something went wrong. Please report issue.'.format( response_text=response_text, status_code=status_code), status_code)
class Instagramexception(Exception): status_code = -1 def __init__(self, message='', code=500): super().__init__(f'{message}, Code:{code}') @staticmethod def default(response_text, status_code): status_code = status_code return instagram_exception('Response code is {status_code}. Body: {response_text} Something went wrong. Please report issue.'.format(response_text=response_text, status_code=status_code), status_code)
class Spawn: def __init__ (self, width, height): self.width, self.height, self.spacing = self.fill = width, height, 100, d3.scale.category20 () self.svg = d3.select ('body' ) .append ('svg' ) .attr ('width', self.width ) .attr ('height', self.height ) .on ('mousemove', self.mousemove ) .on ('mousedown', self.mousedown) self.svg.append ('rect' ) .attr ('width', self.width ) .attr ('height', self.height) self.cursor = self.svg.append ('circle' ) .attr ('r', self.spacing ) .attr ('transform', 'translate ({}, {})' .format (self.width / 2, self.height / 2) ) .attr ('class', 'cursor') self.force = d3.layout.force ( ) .size ([self.width, self.height] ) .nodes ([{}] ) .linkDistance (self.spacing ) .charge (-1000 ) .on ('tick', self.tick) self.nodes, self.links, self.node, self.link = self.force.nodes (), self.force.links (), self.svg.selectAll ('.node'), self.svg.selectAll ('.link') self.restart () def mousemove (self): self.cursor.attr ('transform', 'translate (' + d3.mouse (self.svg.node ()) + ')') def mousedown (self): def pushLink (target): x, y = target.x - node.x, target.y - node.y if Math.sqrt (x * x + y * y) < self.spacing: spawn.links.push ({'source': node, 'target': target}) point = d3.mouse (self.svg.node ()) node = {'x': point [0], 'y': point [1]} self.nodes.push (node) self.nodes.forEach (pushLink) self.restart () def tick (self): self.link.attr ('x1', lambda d: d.source.x ) .attr ('y1', lambda d: d.source.y ) .attr ('x2', lambda d: d.target.x ) .attr ('y2', lambda d: d.target.y) self.node.attr ('cx', lambda d: d.x ) .attr ('cy', lambda d: d.y) def restart (self): self.link = self.link.data (self.links) self.link.enter ( ) .insert ('line', '.node' ) .attr('class', 'link') self.node = self.node.data (self.nodes) self.node.enter ( ) .insert ('circle', '.cursor' ) .attr ('class', 'node' ) .attr ('r', 7 ) .call (self.force.drag) self.force.start () spawn = Spawn (window.innerWidth, window.innerHeight)
class Spawn: def __init__(self, width, height): (self.width, self.height, self.spacing) = self.fill = (width, height, 100, d3.scale.category20()) self.svg = d3.select('body').append('svg').attr('width', self.width).attr('height', self.height).on('mousemove', self.mousemove).on('mousedown', self.mousedown) self.svg.append('rect').attr('width', self.width).attr('height', self.height) self.cursor = self.svg.append('circle').attr('r', self.spacing).attr('transform', 'translate ({}, {})'.format(self.width / 2, self.height / 2)).attr('class', 'cursor') self.force = d3.layout.force().size([self.width, self.height]).nodes([{}]).linkDistance(self.spacing).charge(-1000).on('tick', self.tick) (self.nodes, self.links, self.node, self.link) = (self.force.nodes(), self.force.links(), self.svg.selectAll('.node'), self.svg.selectAll('.link')) self.restart() def mousemove(self): self.cursor.attr('transform', 'translate (' + d3.mouse(self.svg.node()) + ')') def mousedown(self): def push_link(target): (x, y) = (target.x - node.x, target.y - node.y) if Math.sqrt(x * x + y * y) < self.spacing: spawn.links.push({'source': node, 'target': target}) point = d3.mouse(self.svg.node()) node = {'x': point[0], 'y': point[1]} self.nodes.push(node) self.nodes.forEach(pushLink) self.restart() def tick(self): self.link.attr('x1', lambda d: d.source.x).attr('y1', lambda d: d.source.y).attr('x2', lambda d: d.target.x).attr('y2', lambda d: d.target.y) self.node.attr('cx', lambda d: d.x).attr('cy', lambda d: d.y) def restart(self): self.link = self.link.data(self.links) self.link.enter().insert('line', '.node').attr('class', 'link') self.node = self.node.data(self.nodes) self.node.enter().insert('circle', '.cursor').attr('class', 'node').attr('r', 7).call(self.force.drag) self.force.start() spawn = spawn(window.innerWidth, window.innerHeight)
class Queue(object): def __init__(self): super(Queue, self).__init__() self.rear = -1 self.front = -1 self.MAX = 10 self.queue = [None]*self.MAX def enqueue(self,element): if(self.rear == self.MAX - 1): print("Error- queue full") else: self.rear += 1 self.queue[self.rear] = element if self.rear == 0: self.front = 0; return; def dequeue(self): if(self.rear == -1): print("Error- queue empty") else: out = self.queue[self.front] self.front += 1 if(self.front > self.rear): self.front = self.rear = -1; return out return -1 def display(self): print('queue: ', end="") for i in range(self.front, self.rear+1): print(str(self.queue[i])+" ", end="") print() def createQueue(self, *elements): for element in elements: self.enqueue(element) def isEmpty(self): if(self.front == -1 or self.front > self.rear): return True return False
class Queue(object): def __init__(self): super(Queue, self).__init__() self.rear = -1 self.front = -1 self.MAX = 10 self.queue = [None] * self.MAX def enqueue(self, element): if self.rear == self.MAX - 1: print('Error- queue full') else: self.rear += 1 self.queue[self.rear] = element if self.rear == 0: self.front = 0 return def dequeue(self): if self.rear == -1: print('Error- queue empty') else: out = self.queue[self.front] self.front += 1 if self.front > self.rear: self.front = self.rear = -1 return out return -1 def display(self): print('queue: ', end='') for i in range(self.front, self.rear + 1): print(str(self.queue[i]) + ' ', end='') print() def create_queue(self, *elements): for element in elements: self.enqueue(element) def is_empty(self): if self.front == -1 or self.front > self.rear: return True return False
n=int(input()) arr=[[input(),float(input())] for _ in range(0,n)] arr.sort(key=lambda x: (x[1],x[0])) names = [i[0] for i in arr] marks = [i[1] for i in arr] min_val=min(marks) while marks[0]==min_val: marks.remove(marks[0]) names.remove(names[0]) for x in range(0,len(marks)): if marks[x]==min(marks): print(names[x])
n = int(input()) arr = [[input(), float(input())] for _ in range(0, n)] arr.sort(key=lambda x: (x[1], x[0])) names = [i[0] for i in arr] marks = [i[1] for i in arr] min_val = min(marks) while marks[0] == min_val: marks.remove(marks[0]) names.remove(names[0]) for x in range(0, len(marks)): if marks[x] == min(marks): print(names[x])
sse3=1 debug=0 strict=1 osx_min_ver = '10.7' compiler = 'clang' osx_archs = 'x86_64' cxxstd = 'c++14' ccflags = '-stdlib=libc++ -Wno-unused-local-typedefs' linkflags = '-stdlib=libc++' package_arch = 'x86_64' #disable_local = 'libevent re2' sign_disable = 1 sign_keychain = 'login.keychain' #sign_keychain = 'developer.jane.doe.keychain' # parts of the build system don't know about sign_disable # so you MUST comment-out sign_id_installer if it is not valid #sign_id_installer = 'Developer ID Installer: Jane Doe (C123456789)' sign_id_app = 'Developer ID Application: Jane Doe (C123456789)' sign_prefix = 'org.foldingathome.' notarize_disable = 1 notarize_user = 'example.jane.doe@icloud.com' notarize_pass = '@keychain:Developer altool: Jane Doe' notarize_asc = 'C123456789' notarize_team = 'C123456789'
sse3 = 1 debug = 0 strict = 1 osx_min_ver = '10.7' compiler = 'clang' osx_archs = 'x86_64' cxxstd = 'c++14' ccflags = '-stdlib=libc++ -Wno-unused-local-typedefs' linkflags = '-stdlib=libc++' package_arch = 'x86_64' sign_disable = 1 sign_keychain = 'login.keychain' sign_id_app = 'Developer ID Application: Jane Doe (C123456789)' sign_prefix = 'org.foldingathome.' notarize_disable = 1 notarize_user = 'example.jane.doe@icloud.com' notarize_pass = '@keychain:Developer altool: Jane Doe' notarize_asc = 'C123456789' notarize_team = 'C123456789'
#define the main() function def main(): i = 0 #declare interger i x = 119.0 #declare float x for i in range(120): #loop i from 0 to 119, inclusive if((i%2)==0): #if i is even x += 3. #add 3 to x else: #if not true x -= 5. #substract 5 from x s = "%3.2e" % x #make a string containing x with sci. notation of 2 decimals print(s) #print s to the screen if __name__=="__main__": #if the main() function exists,run it main()
def main(): i = 0 x = 119.0 for i in range(120): if i % 2 == 0: x += 3.0 else: x -= 5.0 s = '%3.2e' % x print(s) if __name__ == '__main__': main()
# 7. Write a program that takes any two lists L and M of the same size and adds their elements # together to form a new list N whose elements are sums of the corresponding elements in L # and M. For instance, if L=[3,1,4] and M=[1,5,9], then N should equal [4,6,13]. L = input('Enter a list of numbers: ').split() M = input('Enter another list of numbers: ').split() N = [] for i in range(len(L)): N.append(int(L[i]) + int(M[i])) # N = [(int(L[i]) + int(M[i])) for i in range(len(L))] print(N)
l = input('Enter a list of numbers: ').split() m = input('Enter another list of numbers: ').split() n = [] for i in range(len(L)): N.append(int(L[i]) + int(M[i])) print(N)
class Solution: def canConstruct(self, s: str, k: int) -> bool: if len(s) < k: return False if len(s) == k: return True letters = collections.Counter(s) mid = [] for key, val in letters.items(): if val % 2 == 1: mid.append(key) if len(mid) > k: return False return True
class Solution: def can_construct(self, s: str, k: int) -> bool: if len(s) < k: return False if len(s) == k: return True letters = collections.Counter(s) mid = [] for (key, val) in letters.items(): if val % 2 == 1: mid.append(key) if len(mid) > k: return False return True
class NoChefException(Exception): pass class Chef(object): def make(self, **params): print("I am a chef") class Boost(Chef): def make(self, food=None, **keywords): print("I can cook %s for robots" % food) class Fry(Chef): def make(self, food=None): print("I can fry " + food) class Bake(Chef): def make(self, food=None): print("I can bake " + food) PLUGINS = { "Portable Battery": Boost, "Fish and Chips": Fry, "Cornish Scone": Bake, "Jacket Potato": Bake, } def get_a_plugin(food_name=None, **keywords): plugin = PLUGINS.get(food_name) if plugin is None: raise NoChefException("Cannot find a chef") plugin_cls = plugin() return plugin_cls
class Nochefexception(Exception): pass class Chef(object): def make(self, **params): print('I am a chef') class Boost(Chef): def make(self, food=None, **keywords): print('I can cook %s for robots' % food) class Fry(Chef): def make(self, food=None): print('I can fry ' + food) class Bake(Chef): def make(self, food=None): print('I can bake ' + food) plugins = {'Portable Battery': Boost, 'Fish and Chips': Fry, 'Cornish Scone': Bake, 'Jacket Potato': Bake} def get_a_plugin(food_name=None, **keywords): plugin = PLUGINS.get(food_name) if plugin is None: raise no_chef_exception('Cannot find a chef') plugin_cls = plugin() return plugin_cls
class Range: def __init__(self, left, right, left_inclusive=True, right_inclusive=False): self.left = left self.right = right self.left_inclusive = left_inclusive self.right_inclusive = right_inclusive def __contains__(self, item): if self.left_inclusive and self.left == item: return True if self.right_inclusive and self.right == item: return True return self.left < item < self.right class OpenRange(Range): def __init__(self, left, right): super().__init__(left, right, False, False) class ClosedRange(Range): def __init__(self, left, right): super().__init__(left, right, True, True)
class Range: def __init__(self, left, right, left_inclusive=True, right_inclusive=False): self.left = left self.right = right self.left_inclusive = left_inclusive self.right_inclusive = right_inclusive def __contains__(self, item): if self.left_inclusive and self.left == item: return True if self.right_inclusive and self.right == item: return True return self.left < item < self.right class Openrange(Range): def __init__(self, left, right): super().__init__(left, right, False, False) class Closedrange(Range): def __init__(self, left, right): super().__init__(left, right, True, True)
alphabet_dict = { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26, '1': 27, '2': 28, '3': 29, '4': 30, '5': 31, '6': 32, '7': 33, '8': 34, '9': 35, '-': 36, ',': 37, ';': 38, '.': 39, '!': 40, '?': 41, ':': 42, "'": 43, '/"': 44, '\\': 45, '|': 46, '_': 47, '@': 48, '#': 49, '$': 50, '%': 51, '^': 52, '&': 53, '*': 54, '~': 55, '`': 56, '+': 57, '=': 58, '<': 59, '>': 60, '(': 61, ')': 62, '[': 63, ']': 64, '{': 65, '}': 66, }
alphabet_dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26, '1': 27, '2': 28, '3': 29, '4': 30, '5': 31, '6': 32, '7': 33, '8': 34, '9': 35, '-': 36, ',': 37, ';': 38, '.': 39, '!': 40, '?': 41, ':': 42, "'": 43, '/"': 44, '\\': 45, '|': 46, '_': 47, '@': 48, '#': 49, '$': 50, '%': 51, '^': 52, '&': 53, '*': 54, '~': 55, '`': 56, '+': 57, '=': 58, '<': 59, '>': 60, '(': 61, ')': 62, '[': 63, ']': 64, '{': 65, '}': 66}
_base_ = './grid_rcnn_r50_fpn_gn-head_2x_coco.py' model = dict( pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch')) # optimizer optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=3665, warmup_ratio=1.0 / 80, step=[17, 23]) total_epochs = 25
_base_ = './grid_rcnn_r50_fpn_gn-head_2x_coco.py' model = dict(pretrained='open-mmlab://resnext101_32x4d', backbone=dict(type='ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch')) optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) lr_config = dict(policy='step', warmup='linear', warmup_iters=3665, warmup_ratio=1.0 / 80, step=[17, 23]) total_epochs = 25
#!/usr/bin/env python # -*- coding: utf-8 -*- #Reference https://ebisuke33.hatenablog.com/entry/abc197c def main(): N = int(input()) array = list(map(int,input().split())) ans = 10**9+7 if N==1: print(array[0]) exit() for i in range(2**(N-1)): base = 0 or_value = array[0] for j in range(1,N): if (i>>(j-1)) & 1: base ^= or_value or_value = 0 or_value |= array[j] else: or_value |= array[j] base ^= or_value ans = min(ans,base) print(ans) if __name__ == '__main__': main()
def main(): n = int(input()) array = list(map(int, input().split())) ans = 10 ** 9 + 7 if N == 1: print(array[0]) exit() for i in range(2 ** (N - 1)): base = 0 or_value = array[0] for j in range(1, N): if i >> j - 1 & 1: base ^= or_value or_value = 0 or_value |= array[j] else: or_value |= array[j] base ^= or_value ans = min(ans, base) print(ans) if __name__ == '__main__': main()
print("(1, 2, 3) < (1, 2, 4) :", (1, 2, 3) < (1, 2, 4)) print("[1, 2, 3] < [1, 2, 4] :", [1, 2, 3] < [1, 2, 4]) print("'ABC' < 'C' < 'Pascal' < 'Python' :", 'ABC' < 'C' < 'Pascal' < 'Python') print("(1, 2, 3, 4) < (1, 2, 4) :", (1, 2, 3, 4) < (1, 2, 4)) print("(1, 2) < (1, 2, -1) :", (1, 2) < (1, 2, -1)) print("(1, 2, 3) == (1.0, 2.0, 3.0) :", (1, 2, 3) == (1.0, 2.0, 3.0)) print("(1, 2, ('aa', 'bb')) < (1, 2, ('abc', 'a'), 4) :", (1, 2, ('aa', 'bb')) < (1, 2, ('abc', 'a'), 4))
print('(1, 2, 3) < (1, 2, 4) :', (1, 2, 3) < (1, 2, 4)) print('[1, 2, 3] < [1, 2, 4] :', [1, 2, 3] < [1, 2, 4]) print("'ABC' < 'C' < 'Pascal' < 'Python' :", 'ABC' < 'C' < 'Pascal' < 'Python') print('(1, 2, 3, 4) < (1, 2, 4) :', (1, 2, 3, 4) < (1, 2, 4)) print('(1, 2) < (1, 2, -1) :', (1, 2) < (1, 2, -1)) print('(1, 2, 3) == (1.0, 2.0, 3.0) :', (1, 2, 3) == (1.0, 2.0, 3.0)) print("(1, 2, ('aa', 'bb')) < (1, 2, ('abc', 'a'), 4) :", (1, 2, ('aa', 'bb')) < (1, 2, ('abc', 'a'), 4))
#Spiral Traversal def spiralTraverse(array): # Write your code here. result=[] startRow=0 startCol=0 endRow=len(array)-1 endCol=len(array[0])-1 while startRow<=endRow and startCol<=endCol: for col in range(startCol, endCol+1): print(col) result.append(array[startRow][col]) for row in range(startRow+1, endRow+1): print(row) result.append(array[row][endCol]) for col in reversed(range(startCol, endCol)): print(col) if startRow==endRow: break result.append(array[endRow][col]) for row in reversed(range(startRow+1, endRow)): print(row) if startCol==endCol: break result.append(array[row][startCol]) startRow+=1 endRow-=1 startCol+=1 endCol-=1 print(result) return result
def spiral_traverse(array): result = [] start_row = 0 start_col = 0 end_row = len(array) - 1 end_col = len(array[0]) - 1 while startRow <= endRow and startCol <= endCol: for col in range(startCol, endCol + 1): print(col) result.append(array[startRow][col]) for row in range(startRow + 1, endRow + 1): print(row) result.append(array[row][endCol]) for col in reversed(range(startCol, endCol)): print(col) if startRow == endRow: break result.append(array[endRow][col]) for row in reversed(range(startRow + 1, endRow)): print(row) if startCol == endCol: break result.append(array[row][startCol]) start_row += 1 end_row -= 1 start_col += 1 end_col -= 1 print(result) return result
# TODO Find a way to actually configure these :D BASE_URL = 'http://localhost:8000/' MAILCATCHER_URL = 'http://localhost:1080/'
base_url = 'http://localhost:8000/' mailcatcher_url = 'http://localhost:1080/'
''' @Author: Yingshi Chen @Date: 2020-03-20 17:39:56 @ # Description: '''
""" @Author: Yingshi Chen @Date: 2020-03-20 17:39:56 @ # Description: """
#Ricky Deegan #check if one number divides another p = 8 m = 2 if (p % m) == 0: print (p, "divided by", m, "leaves a remainder of zero") print ("I'll be run too if the condition is true") else: print (p, "divided by", m, "does not leave leaves a remainder of zero") print ("I'll be run too if the condition is false") print("I'll run no matter what")
p = 8 m = 2 if p % m == 0: print(p, 'divided by', m, 'leaves a remainder of zero') print("I'll be run too if the condition is true") else: print(p, 'divided by', m, 'does not leave leaves a remainder of zero') print("I'll be run too if the condition is false") print("I'll run no matter what")
stim_positions = { 'double' : [ [( .4584, .2575, .2038), # 3d location ( .4612, .2690,-.0283)], [( .4601, .1549, .1937), ( .4614, .1660,-.0358)] ], 'double_20070301' : [ [( .4538, .2740, .1994), # top highy ( .4565, .2939,-0.0531)], [ (.4516, .1642, .1872), # top lowy ( .4541, .1767,-.0606)]], 'half' : [ [( .4567, .2029, .1958), ( .4581, .2166,-.0329)], ], 'half_20070303' : [ [( .4628, .2066, .1920), ( .4703, .2276,-.0555) ]], 'tall' : [ [( .4562, .1951, .2798), ( .4542, .2097,-.0325)], ], ##from 20061205: ##tall=[( 456.2, 195.1, 279.8), ## ( 454.2, 209.7,-32.5)] ##from 20061212: ##short=[( 461.4, 204.2, 128.1), ## ( 462.5, 205.3, 114.4)] ##from 20061219: ##necklace = [( 455.9, 194.4, 262.8), ## ( 456.2, 212.8,-42.2)] ## 'no post (smoothed)' : [( .4562, .1951, .2798), ## ( .4542, .2097,-.0325)], 'short': [[( .4614, .2042, .1281), ( .4625, .2053, .1144)]], 'necklace' : [[( .4559, .1944, .2628), ( .4562, .2128,-.0422)]], None : [], }
stim_positions = {'double': [[(0.4584, 0.2575, 0.2038), (0.4612, 0.269, -0.0283)], [(0.4601, 0.1549, 0.1937), (0.4614, 0.166, -0.0358)]], 'double_20070301': [[(0.4538, 0.274, 0.1994), (0.4565, 0.2939, -0.0531)], [(0.4516, 0.1642, 0.1872), (0.4541, 0.1767, -0.0606)]], 'half': [[(0.4567, 0.2029, 0.1958), (0.4581, 0.2166, -0.0329)]], 'half_20070303': [[(0.4628, 0.2066, 0.192), (0.4703, 0.2276, -0.0555)]], 'tall': [[(0.4562, 0.1951, 0.2798), (0.4542, 0.2097, -0.0325)]], 'short': [[(0.4614, 0.2042, 0.1281), (0.4625, 0.2053, 0.1144)]], 'necklace': [[(0.4559, 0.1944, 0.2628), (0.4562, 0.2128, -0.0422)]], None: []}
def test_NEQSys(): pass def test_SimpleNEQSys(): pass
def test_neq_sys(): pass def test__simple_neq_sys(): pass
def str_or_list_to_list(path_or_paths): if isinstance(path_or_paths, str): # parameter is a string, turn it into a list of strings paths = [path_or_paths] else: # parameter is a list paths = path_or_paths return paths
def str_or_list_to_list(path_or_paths): if isinstance(path_or_paths, str): paths = [path_or_paths] else: paths = path_or_paths return paths
def f(a, b): return a + b def g(): i = 0 while i < 10: a = 'foo' i += 1 def h(): [x for x in range(10)]
def f(a, b): return a + b def g(): i = 0 while i < 10: a = 'foo' i += 1 def h(): [x for x in range(10)]
if __name__ == "__main__": count = 0 resolution = 10000 iota = 1 / resolution a = 0 b = 0 while a <= 1: b = 0 while b <= 1: if (pow(a, 2) + pow(b, 2)) <= (2 * min(a, b)): count = count + 1 b += iota a += iota print(f"Count is: {count} area is {pow(resolution, 2)}, internal area is {count / (pow(resolution, 2))}")
if __name__ == '__main__': count = 0 resolution = 10000 iota = 1 / resolution a = 0 b = 0 while a <= 1: b = 0 while b <= 1: if pow(a, 2) + pow(b, 2) <= 2 * min(a, b): count = count + 1 b += iota a += iota print(f'Count is: {count} area is {pow(resolution, 2)}, internal area is {count / pow(resolution, 2)}')
class GradScaler(object): def __init__( self, init_scale, growth_factor, backoff_factor, growth_interval, enabled ): self.scale_factor = init_scale self.growth_factor = growth_factor self.backoff_factor = backoff_factor self.growth_interval = growth_interval self.enabled = enabled self.unskipped_iter = 0 def scale(self, outputs): if not self.enabled: return outputs return self.scale_factor * outputs def unscale(self, optimizer): if not self.enabled: return for param in optimizer.param_groups[0]["params"]: if param.grad.isnan().any() or param.grad.isinf().any(): optimizer.zero_grad() self.scale_factor *= self.backoff_factor self.unskipped_iter = 0 return for param in optimizer.param_groups[0]["params"]: param.grad /= self.scale_factor self.unskipped_iter += 1 if self.unskipped_iter >= self.growth_interval: self.scale_factor *= self.growth_factor self.unskipped_iter = 0
class Gradscaler(object): def __init__(self, init_scale, growth_factor, backoff_factor, growth_interval, enabled): self.scale_factor = init_scale self.growth_factor = growth_factor self.backoff_factor = backoff_factor self.growth_interval = growth_interval self.enabled = enabled self.unskipped_iter = 0 def scale(self, outputs): if not self.enabled: return outputs return self.scale_factor * outputs def unscale(self, optimizer): if not self.enabled: return for param in optimizer.param_groups[0]['params']: if param.grad.isnan().any() or param.grad.isinf().any(): optimizer.zero_grad() self.scale_factor *= self.backoff_factor self.unskipped_iter = 0 return for param in optimizer.param_groups[0]['params']: param.grad /= self.scale_factor self.unskipped_iter += 1 if self.unskipped_iter >= self.growth_interval: self.scale_factor *= self.growth_factor self.unskipped_iter = 0
# -*- coding: utf-8 -*- __all__ = [] __version__ = '0.0' FONTS = [ { "name": "Roboto", "fn_regular": fonts_path + 'Roboto-Regular.ttf', "fn_bold": fonts_path + 'Roboto-Medium.ttf', "fn_italic": fonts_path + 'Roboto-Italic.ttf', "fn_bolditalic": fonts_path + 'Roboto-MediumItalic.ttf' }, { "name": "RobotoLight", "fn_regular": fonts_path + 'Roboto-Thin.ttf', "fn_bold": fonts_path + 'Roboto-Light.ttf', "fn_italic": fonts_path + 'Roboto-ThinItalic.ttf', "fn_bolditalic": fonts_path + 'Roboto-LightItalic.ttf' }, { "name": "Icons", "fn_regular": fonts_path + 'materialdesignicons-webfont.ttf' } ]
__all__ = [] __version__ = '0.0' fonts = [{'name': 'Roboto', 'fn_regular': fonts_path + 'Roboto-Regular.ttf', 'fn_bold': fonts_path + 'Roboto-Medium.ttf', 'fn_italic': fonts_path + 'Roboto-Italic.ttf', 'fn_bolditalic': fonts_path + 'Roboto-MediumItalic.ttf'}, {'name': 'RobotoLight', 'fn_regular': fonts_path + 'Roboto-Thin.ttf', 'fn_bold': fonts_path + 'Roboto-Light.ttf', 'fn_italic': fonts_path + 'Roboto-ThinItalic.ttf', 'fn_bolditalic': fonts_path + 'Roboto-LightItalic.ttf'}, {'name': 'Icons', 'fn_regular': fonts_path + 'materialdesignicons-webfont.ttf'}]
# TODO(dragondriver): add more default configs to here class DefaultConfigs: MaxSearchResultSize = 100 * 1024 * 1024 WaitTimeDurationWhenLoad = 0.5 # in seconds
class Defaultconfigs: max_search_result_size = 100 * 1024 * 1024 wait_time_duration_when_load = 0.5
def f(): n = 0 while True: n = yield n + 1 print(n) g = f() try: g.send(1) print("FAIL") raise SystemExit except TypeError: print("caught") print(g.send(None)) print(g.send(100)) print(g.send(200)) def f2(): print("entering") for i in range(3): print(i) yield print("returning 1") print("returning 2") g = f2() g.send(None) g.send(1) g.send(1) try: g.send(1) print("FAIL") raise SystemExit except StopIteration: print("caught") try: g.send(1) print("FAIL") raise SystemExit except StopIteration: print("caught") print("PASS")
def f(): n = 0 while True: n = (yield (n + 1)) print(n) g = f() try: g.send(1) print('FAIL') raise SystemExit except TypeError: print('caught') print(g.send(None)) print(g.send(100)) print(g.send(200)) def f2(): print('entering') for i in range(3): print(i) yield print('returning 1') print('returning 2') g = f2() g.send(None) g.send(1) g.send(1) try: g.send(1) print('FAIL') raise SystemExit except StopIteration: print('caught') try: g.send(1) print('FAIL') raise SystemExit except StopIteration: print('caught') print('PASS')
# What substring do hish and fish have in common ? # How about hish and vista ? # Thats what we'll calculate # grid cell = [] word_a = 'fosh' word_b = 'fort' l_c_s = 0 # initiating with 0 values for a in range(0, len(word_a)): cell.append(list(0 for b in word_b)) for i in range(0, len(word_a)): for j in range(0, len(word_b)): if word_a[i] == word_b[j]: cell[i][j] = cell[i-1][j-1] + 1 # recording the longest common substring because answer is not always in last cell l_c_s = max(l_c_s, cell[i][j]) else: cell[i][j] = 0 for c in cell: print(c) print('Longest common substring: {l}'.format(l=l_c_s))
cell = [] word_a = 'fosh' word_b = 'fort' l_c_s = 0 for a in range(0, len(word_a)): cell.append(list((0 for b in word_b))) for i in range(0, len(word_a)): for j in range(0, len(word_b)): if word_a[i] == word_b[j]: cell[i][j] = cell[i - 1][j - 1] + 1 l_c_s = max(l_c_s, cell[i][j]) else: cell[i][j] = 0 for c in cell: print(c) print('Longest common substring: {l}'.format(l=l_c_s))
class Group(object): def __init__(self, id=None, name=None, members=None) -> None: self.id = id self.name = name self.members = [] def setId(self, id): self.id = id def getId(self): return self.id def setName(self, name): self.id = name def getName(self): return self.name def setMembers(self, memberList): self.members = memberList def getMembers(self): return self.members
class Group(object): def __init__(self, id=None, name=None, members=None) -> None: self.id = id self.name = name self.members = [] def set_id(self, id): self.id = id def get_id(self): return self.id def set_name(self, name): self.id = name def get_name(self): return self.name def set_members(self, memberList): self.members = memberList def get_members(self): return self.members
# CONFIGURATION # -------------------------------------------------------------------------------------------- y_min = 0 # minimum value displayed on y axis y_max = 100 # maximum value displayed on y axis (maximum must be greater (not greater or equal) than minimum) x_min = 0 # minimum value displayed on x axis x_max = 100 # maximum value displayed on x axis (maximum must be greater (not greater or equal) than minimum) inputs = ["input1","input2"] # name of the input ports. It cooresponds to x and y axis output = "output" # name of the output port chart_color = "#2E86C1" # point chart color. blue = 2E86C1 , yellow = F4D03F, orange = E67E22 chart_height = 500 # height of the chart in pixels chart_width = 500 # width of the chart in pixel num_y_labels = 4 # number of labels dispyed on y axis. min and max values are not displayed num_x_labels = 4 # number of labels dispyed on x axis. min and max values are not displayed label_decimals = 0 # number of decimal places used for displaying labels on y axis.label_decimals = 0 -> integers are displayed graph_name = "User Segmentation" # title/graph name # ------------------------------------------------------------------------------------------- # INTERNAL CONFIGURATION - CHANGE ONLY IF YOU KNOW WHAT ARE YOU DOING # ------------------------------------------------------------------------------------------ line_offset = 15 # chart line starts from x_zero position. it is a shift left on the chart for y axis labels font_size = 12 # font size background_color = "#212F3C" # dark blue # ------------------------------------------------------------------------------------------ # INTERNAL CONFIGURATION - DO NOT CHANGE # ------------------------------------------------------------------------------------------- y_range = y_max - y_min # range of y values calculated from configuration parameters. x_range = x_max - x_min # range of x values calculated from configuration parameters. font_size_px = font_size * 0.6667 # font size in pixels, important for indentation on y axis label_pattern = "{0:."+str(label_decimals)+"f}" # pattern which is used to format values on y axis # HTML TEMPLATES # ------------------------------------------------------------------------------------------ html = ''' <style> body, html { height: 100%; background-color: '''+background_color+'''} .graph-container { width: 100%; height: 90%; padding-top: 20px; } .chart { background: '''+background_color+'''; width: '''+str(chart_width)+'''px; height: '''+str(chart_height)+'''px; } </style> <br> <div align="center" ><font face="verdana" color="white">'''+graph_name+'''</font></div> <div align="center" class="graph-container"> <div class="chart-box"> <svg viewBox="0 0 '''+str(chart_width)+''' '''+str(chart_height)+'''" class="chart"> #y_labels #x_labels #points </svg> </div> </div> ''' point = '''<circle cx="#x_coord" cy="#y_coord" r="3" stroke="none" fill="#color" /> ''' horizontal_line = ''' <polyline fill="none" stroke="#989898" stroke-width="0.3" points=" '''+str(line_offset)+''', #y_pos, '''+str(chart_width)+''', #y_pos "/> ''' y_axis_text = ''' <text font-family="verdana" font-size="'''+str(font_size)+'''px" fill="white" y="#y_pos" >#y_value</text> ''' vertical_line = ''' <polyline fill="none" stroke="#989898" stroke-width="0.3" points=" #x_pos, 0, #x_pos, '''+str(chart_height - line_offset)+''' "/> ''' x_axis_text = ''' <text font-family="verdana" font-size="'''+str(font_size)+'''px" fill="white" y="'''+str(chart_height - 2)+'''" x="#x_pos" >#x_value</text> ''' # ------------------------------------------------------------------------------------------ # DRAWING CODE # ------------------------------------------------------------------------------------------ points = "" # calculate y value for input value. Input value is received from input port and must be integer or float. # input: value (float or integer) # return: y value in pixels (integer) def calculate_y(value): global y_range y_relative = (value - y_min) / y_range y_absolute = y_relative * chart_height y = chart_height - y_absolute return y def calculate_x(value): global x_range x_relative = (value - x_min) / x_range x_absolute = x_relative * chart_width x = x_absolute return x # create html which draws horizontal axis and corresponding values def create_y_labels_html(num_y_labels): global y_min global y_max global y_range html_labels = "" if (num_y_labels <= 0): return html_labels; n_y_steps = num_y_labels + 1 y_step = y_range / (n_y_steps) for curr in range(1,n_y_steps): y_value = y_min + (y_step * curr) y_value_display = label_pattern.format(y_value) y_pos = calculate_y(y_value) html_labels += horizontal_line.replace("#y_pos",str(y_pos)) html_labels += y_axis_text.replace("#y_pos",str(y_pos + font_size_px/2)).replace("#y_value",y_value_display) return html_labels def create_x_labels_html(num_x_labels): global x_min global x_max global x_range html_labels = "" if (num_x_labels <= 0): return html_labels; n_x_steps = num_x_labels + 1 x_step = x_range / (n_x_steps) for curr in range(1,n_x_steps): x_value = x_min + (x_step * curr) x_value_display = label_pattern.format(x_value) x_pos = calculate_x(x_value) html_labels += vertical_line.replace("#x_pos",str(x_pos)) html_labels += x_axis_text.replace("#x_pos",str(x_pos - 8)).replace("#x_value", x_value_display) return html_labels # function which will be triggered when new data are received on port # input: value (string encoded number) def on_input(value1, value2): global html global point global points global chart_color val1 = float(value1) # value x val2 = float(value2) # value y x_val = calculate_x(val1) y_val = calculate_y(val2) circle = point.replace("#x_coord",str(x_val)).replace("#y_coord", str(y_val)).replace("#color", chart_color) points += circle html_tmp = html.replace("#points", points) api.send(output, html_tmp) api.set_port_callback(inputs, on_input) # generate x and y labels on start html = html.replace("#y_labels", create_y_labels_html(num_y_labels)) html = html.replace("#x_labels", create_x_labels_html(num_x_labels))
y_min = 0 y_max = 100 x_min = 0 x_max = 100 inputs = ['input1', 'input2'] output = 'output' chart_color = '#2E86C1' chart_height = 500 chart_width = 500 num_y_labels = 4 num_x_labels = 4 label_decimals = 0 graph_name = 'User Segmentation' line_offset = 15 font_size = 12 background_color = '#212F3C' y_range = y_max - y_min x_range = x_max - x_min font_size_px = font_size * 0.6667 label_pattern = '{0:.' + str(label_decimals) + 'f}' html = '\n<style>\n body, html { height: 100%; background-color: ' + background_color + '}\n .graph-container { width: 100%; height: 90%; padding-top: 20px; }\n .chart { background: ' + background_color + '; width: ' + str(chart_width) + 'px; height: ' + str(chart_height) + 'px; }\n</style>\n<br>\n<div align="center" ><font face="verdana" color="white">' + graph_name + '</font></div> \n<div align="center" class="graph-container"> \n <div class="chart-box">\n <svg viewBox="0 0 ' + str(chart_width) + ' ' + str(chart_height) + '" class="chart">\n \n #y_labels \n #x_labels\n #points\n \n </svg>\n </div>\n</div>\n' point = '<circle cx="#x_coord" cy="#y_coord" r="3" stroke="none" fill="#color" />\n' horizontal_line = '\n<polyline fill="none" stroke="#989898" stroke-width="0.3" points=" ' + str(line_offset) + ', #y_pos, ' + str(chart_width) + ', #y_pos "/>\n' y_axis_text = '\n<text font-family="verdana" font-size="' + str(font_size) + 'px" fill="white" y="#y_pos" >#y_value</text>\n' vertical_line = '\n<polyline fill="none" stroke="#989898" stroke-width="0.3" points=" #x_pos, 0, #x_pos, ' + str(chart_height - line_offset) + ' "/>\n' x_axis_text = '\n<text font-family="verdana" font-size="' + str(font_size) + 'px" fill="white" y="' + str(chart_height - 2) + '" x="#x_pos" >#x_value</text>\n' points = '' def calculate_y(value): global y_range y_relative = (value - y_min) / y_range y_absolute = y_relative * chart_height y = chart_height - y_absolute return y def calculate_x(value): global x_range x_relative = (value - x_min) / x_range x_absolute = x_relative * chart_width x = x_absolute return x def create_y_labels_html(num_y_labels): global y_min global y_max global y_range html_labels = '' if num_y_labels <= 0: return html_labels n_y_steps = num_y_labels + 1 y_step = y_range / n_y_steps for curr in range(1, n_y_steps): y_value = y_min + y_step * curr y_value_display = label_pattern.format(y_value) y_pos = calculate_y(y_value) html_labels += horizontal_line.replace('#y_pos', str(y_pos)) html_labels += y_axis_text.replace('#y_pos', str(y_pos + font_size_px / 2)).replace('#y_value', y_value_display) return html_labels def create_x_labels_html(num_x_labels): global x_min global x_max global x_range html_labels = '' if num_x_labels <= 0: return html_labels n_x_steps = num_x_labels + 1 x_step = x_range / n_x_steps for curr in range(1, n_x_steps): x_value = x_min + x_step * curr x_value_display = label_pattern.format(x_value) x_pos = calculate_x(x_value) html_labels += vertical_line.replace('#x_pos', str(x_pos)) html_labels += x_axis_text.replace('#x_pos', str(x_pos - 8)).replace('#x_value', x_value_display) return html_labels def on_input(value1, value2): global html global point global points global chart_color val1 = float(value1) val2 = float(value2) x_val = calculate_x(val1) y_val = calculate_y(val2) circle = point.replace('#x_coord', str(x_val)).replace('#y_coord', str(y_val)).replace('#color', chart_color) points += circle html_tmp = html.replace('#points', points) api.send(output, html_tmp) api.set_port_callback(inputs, on_input) html = html.replace('#y_labels', create_y_labels_html(num_y_labels)) html = html.replace('#x_labels', create_x_labels_html(num_x_labels))
f=open('4.1.2_run_all_randomize_wholebrain.sh','w') for i in range(1000): cmd='python 4.1_randomize_wholebrain.py %d'%i f.write(cmd+'\n') f.close()
f = open('4.1.2_run_all_randomize_wholebrain.sh', 'w') for i in range(1000): cmd = 'python 4.1_randomize_wholebrain.py %d' % i f.write(cmd + '\n') f.close()
#Given an interval, the task is to count numbers which have same first and last digits. #For example, 1231 has same first and last digits def same_1andlast(s,e): out=[] for i in range(s,e+1): num=i nos=[] while(num!=0): nos.append(num%10) num /= 10 if(nos[0]==nos[len(nos)-1]): out.append(i) return(out,len(out)) print(same_1andlast(7,68))
def same_1andlast(s, e): out = [] for i in range(s, e + 1): num = i nos = [] while num != 0: nos.append(num % 10) num /= 10 if nos[0] == nos[len(nos) - 1]: out.append(i) return (out, len(out)) print(same_1andlast(7, 68))
# Problem: # Write a program for converting money from one currency to another. # The following currencies need to be maintained: BGN, USD, EUR, GBP. # Use the following fixed exchange rates: # BGN = 1.79549 USD / 1.95583 EUR / 2.53405 GBP # The input is a conversion amount + Input Currency + Output Currency. # The output is one number - the converted amount on the above courses, rounded to 2 digits after the decimal point. amount = float(input()) first_currency = input() second_currency = input() result = 0 if first_currency == "BGN": if second_currency == "BGN": result = amount * 1 elif second_currency == "USD": result = amount / 1.79549 elif second_currency == "EUR": result = amount / 1.95583 elif second_currency == "GBP": result = amount / 2.53405 elif first_currency == "USD": if second_currency == "BGN": result = amount * 1.79549 elif second_currency == "USD": result = amount * 1 elif second_currency == "EUR": result = (amount * 1.79549) / 1.95583 elif second_currency == "GBP": result = (amount * 1.79549) / 2.53405 elif first_currency == "EUR": if second_currency == "BGN": result = amount * 1.95583 elif second_currency == "USD": result = (amount * 1.95583 ) / 1.79549 elif second_currency == "EUR": result = amount * 1 elif second_currency == "GBP": result = (amount * 1.95583 ) / 2.53405 elif first_currency == "GBP": if second_currency == "BGN": result = amount * 2.53405 elif second_currency == "USD": result = (amount * 2.53405) / 1.79549 elif second_currency == "EUR": result = (amount * 2.53405) / 1.95583 elif second_currency == "GBP": result = amount * 1 print(float("{0:.2f}".format(result)),second_currency)
amount = float(input()) first_currency = input() second_currency = input() result = 0 if first_currency == 'BGN': if second_currency == 'BGN': result = amount * 1 elif second_currency == 'USD': result = amount / 1.79549 elif second_currency == 'EUR': result = amount / 1.95583 elif second_currency == 'GBP': result = amount / 2.53405 elif first_currency == 'USD': if second_currency == 'BGN': result = amount * 1.79549 elif second_currency == 'USD': result = amount * 1 elif second_currency == 'EUR': result = amount * 1.79549 / 1.95583 elif second_currency == 'GBP': result = amount * 1.79549 / 2.53405 elif first_currency == 'EUR': if second_currency == 'BGN': result = amount * 1.95583 elif second_currency == 'USD': result = amount * 1.95583 / 1.79549 elif second_currency == 'EUR': result = amount * 1 elif second_currency == 'GBP': result = amount * 1.95583 / 2.53405 elif first_currency == 'GBP': if second_currency == 'BGN': result = amount * 2.53405 elif second_currency == 'USD': result = amount * 2.53405 / 1.79549 elif second_currency == 'EUR': result = amount * 2.53405 / 1.95583 elif second_currency == 'GBP': result = amount * 1 print(float('{0:.2f}'.format(result)), second_currency)
''' Hyper Paramators ''' LENGTH = 9 WALLS = 10 BREAK = 96 INPUT_SHAPE = (LENGTH, LENGTH, 4 + WALLS * 2) OUTPUT_SHAPE = 8 + 2 * (LENGTH - 1) * (LENGTH - 1) # Train epoch for one cycle. EPOCHS = 200 # Training epoch number BATCH_SIZE = 256 FILTER = 256 KERNEL = 3 STRIDE = 1 INITIALIZER = 'he_normal' REGULARIZER = 0.0005 RES_NUM = 19 # simulation times per one prediction. SIMULATIONS = 300 #1600 GAMMA = 1.0 # self match times. SELFMATCH = 200 # 25000 CYCLES = 200 PARALLEL_MATCH = 10 # Evaluation times per one evaluation EVAL_MATCH = 10 # 400 C_PUT = 1.0 ALPHA = 0.35 EPS = 0.25
""" Hyper Paramators """ length = 9 walls = 10 break = 96 input_shape = (LENGTH, LENGTH, 4 + WALLS * 2) output_shape = 8 + 2 * (LENGTH - 1) * (LENGTH - 1) epochs = 200 batch_size = 256 filter = 256 kernel = 3 stride = 1 initializer = 'he_normal' regularizer = 0.0005 res_num = 19 simulations = 300 gamma = 1.0 selfmatch = 200 cycles = 200 parallel_match = 10 eval_match = 10 c_put = 1.0 alpha = 0.35 eps = 0.25
_base_ = '../detectors/detectors_htc_r101_64x4d_1x_coco.py' model = dict( pretrained='open-mmlab://resnext101_64x4d', backbone=dict( type='DetectoRS_ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), output_img=True), neck=dict( type='RFP', rfp_steps=2, aspp_out_channels=64, aspp_dilations=(1, 3, 6, 1), rfp_backbone=dict( rfp_inplanes=256, type='DetectoRS_ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), pretrained='open-mmlab://resnext101_64x4d', style='pytorch')), roi_head=dict( bbox_head=[ dict( type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict( type='DeltaXYWHBBoxCoder', target_means=[0., 0., 0., 0.], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=True, loss_cls=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict( type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict( type='DeltaXYWHBBoxCoder', target_means=[0., 0., 0., 0.], target_stds=[0.05, 0.05, 0.1, 0.1]), reg_class_agnostic=True, loss_cls=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict( type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict( type='DeltaXYWHBBoxCoder', target_means=[0., 0., 0., 0.], target_stds=[0.033, 0.033, 0.067, 0.067]), reg_class_agnostic=True, loss_cls=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)) ], mask_head=[ dict( type='HTCMaskHead', with_conv_res=False, num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict( type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)), dict( type='HTCMaskHead', num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict( type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)), dict( type='HTCMaskHead', num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict( type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)) ])) # model training and testing settings train_cfg = dict( rpn=dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, ignore_iof_thr=-1), sampler=dict( type='RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, add_gt_as_proposals=False), allowed_border=0, pos_weight=-1, debug=False), rpn_proposal=dict( nms_across_levels=False, nms_pre=2000, nms_post=2000, max_num=2000, nms_thr=0.7, min_bbox_size=0), rcnn=[ dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.5, min_pos_iou=0.5, ignore_iof_thr=-1), sampler=dict( type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False), dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6, ignore_iof_thr=-1), sampler=dict( type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False), dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.7, min_pos_iou=0.7, ignore_iof_thr=-1), sampler=dict( type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False) ], stage_loss_weights=[1, 0.5, 0.25]) test_cfg = dict( rpn=dict( nms_across_levels=False, nms_pre=1000, nms_post=1000, max_num=1000, nms_thr=0.7, min_bbox_size=0), rcnn=dict( score_thr=0.0001, nms=dict(type='nms', iou_thr=0.5), # LVIS allows up to 300 max_per_img=300, mask_thr_binary=0.5) ) # dataset settings dataset_type = 'LVISDataset' data_root = 'data/lvis/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True, poly2mask=False), dict( type='Resize', img_scale=[(1600, 400), (1600, 1400)], multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='SegRescale', scale_factor=1 / 8), dict(type='DefaultFormatBundle'), dict( type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg']), ] test_pipeline = [ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']), ]) ] data = dict( samples_per_gpu=1, workers_per_gpu=1, train=dict( type='ClassBalancedDataset', oversample_thr=1e-3, dataset=dict( type=dataset_type, ann_file=data_root + 'lvis_v0.5_train.json', seg_prefix=data_root + 'stuffthingmaps/train2017/', img_prefix=data_root + 'train2017/', pipeline=train_pipeline)), val=dict( type=dataset_type, ann_file=data_root + 'lvis_v0.5_val.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline), test=dict( type=dataset_type, ann_file=data_root + 'lvis_v0.5_val.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline)) evaluation = dict(metric=['bbox', 'segm']) # optimizer optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[16, 19]) total_epochs = 20 checkpoint_config = dict(interval=1) # yapf:disable log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook'), # dict(type='TensorboardLoggerHook') ]) # yapf:enable dist_params = dict(backend='nccl') log_level = 'INFO' load_from = None resume_from = None workflow = [('train', 1)]
_base_ = '../detectors/detectors_htc_r101_64x4d_1x_coco.py' model = dict(pretrained='open-mmlab://resnext101_64x4d', backbone=dict(type='DetectoRS_ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), output_img=True), neck=dict(type='RFP', rfp_steps=2, aspp_out_channels=64, aspp_dilations=(1, 3, 6, 1), rfp_backbone=dict(rfp_inplanes=256, type='DetectoRS_ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), pretrained='open-mmlab://resnext101_64x4d', style='pytorch')), roi_head=dict(bbox_head=[dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.05, 0.05, 0.1, 0.1]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1230, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.033, 0.033, 0.067, 0.067]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))], mask_head=[dict(type='HTCMaskHead', with_conv_res=False, num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict(type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)), dict(type='HTCMaskHead', num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict(type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)), dict(type='HTCMaskHead', num_convs=4, in_channels=256, conv_out_channels=256, num_classes=1230, loss_mask=dict(type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))])) train_cfg = dict(rpn=dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, add_gt_as_proposals=False), allowed_border=0, pos_weight=-1, debug=False), rpn_proposal=dict(nms_across_levels=False, nms_pre=2000, nms_post=2000, max_num=2000, nms_thr=0.7, min_bbox_size=0), rcnn=[dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.5, min_pos_iou=0.5, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.7, min_pos_iou=0.7, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False)], stage_loss_weights=[1, 0.5, 0.25]) test_cfg = dict(rpn=dict(nms_across_levels=False, nms_pre=1000, nms_post=1000, max_num=1000, nms_thr=0.7, min_bbox_size=0), rcnn=dict(score_thr=0.0001, nms=dict(type='nms', iou_thr=0.5), max_per_img=300, mask_thr_binary=0.5)) dataset_type = 'LVISDataset' data_root = 'data/lvis/' img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True, poly2mask=False), dict(type='Resize', img_scale=[(1600, 400), (1600, 1400)], multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='SegRescale', scale_factor=1 / 8), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg'])] test_pipeline = [dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])] data = dict(samples_per_gpu=1, workers_per_gpu=1, train=dict(type='ClassBalancedDataset', oversample_thr=0.001, dataset=dict(type=dataset_type, ann_file=data_root + 'lvis_v0.5_train.json', seg_prefix=data_root + 'stuffthingmaps/train2017/', img_prefix=data_root + 'train2017/', pipeline=train_pipeline)), val=dict(type=dataset_type, ann_file=data_root + 'lvis_v0.5_val.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline), test=dict(type=dataset_type, ann_file=data_root + 'lvis_v0.5_val.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline)) evaluation = dict(metric=['bbox', 'segm']) optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) lr_config = dict(policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[16, 19]) total_epochs = 20 checkpoint_config = dict(interval=1) log_config = dict(interval=50, hooks=[dict(type='TextLoggerHook')]) dist_params = dict(backend='nccl') log_level = 'INFO' load_from = None resume_from = None workflow = [('train', 1)]
routers = dict( BASE = dict( routes_onerror = [ ('3muses/*', '3muses/default/handle_error') ] ))
routers = dict(BASE=dict(routes_onerror=[('3muses/*', '3muses/default/handle_error')]))
class Triangulo: def __init__(self): self.lado1 = int(input('Ingrese el primer lado: ')) self.lado2 = int(input('Ingrese el segundo lado: ')) self.lado3 = int(input('Ingrese el tercer lado: ')) def mayor(self): if self.lado1>self.lado2 and self.lado1>self.lado3 : print(f'El lado con valor {self.lado1} es el mayor') elif self.lado2>self.lado3: print(f'El lado con valor {self.lado2} es el mayor') else : print(f'El lado con valor {self.lado3} es el mayor') def calcular(self): if self.lado1 == self.lado2 and self.lado1 == self.lado3 : print('Es un triagunlo equilatero') elif self.lado1 != self.lado2 and self.lado1 != self.lado3 : print('Es un triangulo escaleno') else: print('Es un triangulo isosceles') obj1 = Triangulo() obj1.mayor() obj1.calcular()
class Triangulo: def __init__(self): self.lado1 = int(input('Ingrese el primer lado: ')) self.lado2 = int(input('Ingrese el segundo lado: ')) self.lado3 = int(input('Ingrese el tercer lado: ')) def mayor(self): if self.lado1 > self.lado2 and self.lado1 > self.lado3: print(f'El lado con valor {self.lado1} es el mayor') elif self.lado2 > self.lado3: print(f'El lado con valor {self.lado2} es el mayor') else: print(f'El lado con valor {self.lado3} es el mayor') def calcular(self): if self.lado1 == self.lado2 and self.lado1 == self.lado3: print('Es un triagunlo equilatero') elif self.lado1 != self.lado2 and self.lado1 != self.lado3: print('Es un triangulo escaleno') else: print('Es un triangulo isosceles') obj1 = triangulo() obj1.mayor() obj1.calcular()
__all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__license__", "__copyright__", ] __title__ = "warzone_map_utils" __summary__ = "Map generation and validation repository" __uri__ = "https://github.com/rmudambi/warlight-maps" __version__ = "1.0.0" __author__ = "Beren Erchamion" __license__ = "GNU GPLv3" __copyright__ = f"Copyright 2022 {__author__}"
__all__ = ['__title__', '__summary__', '__uri__', '__version__', '__author__', '__license__', '__copyright__'] __title__ = 'warzone_map_utils' __summary__ = 'Map generation and validation repository' __uri__ = 'https://github.com/rmudambi/warlight-maps' __version__ = '1.0.0' __author__ = 'Beren Erchamion' __license__ = 'GNU GPLv3' __copyright__ = f'Copyright 2022 {__author__}'
def river_travelling(cost_matrix): N = len(cost_matrix) M = [[0 for x in range(N)] for x in range(N)] for steps in range(1, N): for i in range(N - steps): j = i + steps lowest = cost_matrix[i][j] for k in range(i + 1, j): lowest = min(lowest, M[k][j] + M[i][k]) M[i][j] = lowest return M[0][-1]
def river_travelling(cost_matrix): n = len(cost_matrix) m = [[0 for x in range(N)] for x in range(N)] for steps in range(1, N): for i in range(N - steps): j = i + steps lowest = cost_matrix[i][j] for k in range(i + 1, j): lowest = min(lowest, M[k][j] + M[i][k]) M[i][j] = lowest return M[0][-1]
# coding: utf-8 # # Functions (2) - Using Functions # In the last lesson we saw how to create a function using the <code>def</code> keyword. We found out how to pass arguments to a function and how to use these arguments within the function. Finally, we learnt how to return one or many objects from the function, and that we need to assign the output of the function to a variable (or variables). # # In this lesson we're going to practise writing functions. We'll write a few practise functions to help us review what we learnt in the last lesson, before writing a function that we'll actually be able to use when making our charts. # # ## Review - Writing some simple functions # # We'll use this as a opportunity to practise what you've learnt about functions, the exercises below use concepts which you have already learnt in this course. # # ### 1 # Your first challenge is to write a function which takes one string and one number (n). The function should return a string that is n copies of the string: # # ```` # stringMultiply('hi', 5) --> 'hihihihihi' # stringMultiply('one', 2) --> 'oneone' # ```` # ### 2 # Write a function which takes two strings and returns the longer of the two strings. If the strings are the same length return one string which is both strings concatenated together: # # ```` # stringCompare('hi', 'hiya') --> 'hiya' # stringCompare('hi', 'ab') --> 'hiab' # ```` # ### 3 # Write a function which takes one string and one number (n) as inputs. The function should return a string which is the concatenation of the first n characters and the last n characters of the string. If the length of the string is less than n, the function should return "I'm sorry Dave, I can't do that.". # # ```` # stringFirstLast('purple', 2) --> 'pule' # stringFirstLast('hi', 2) --> 'hihi' # stringFirstLast('hi', 3) --> "I'm sorry Dave, I can't do that." # ```` # ## Answers # # These answers do not show the only way of solving the problem, as with everything in programming, there are several solutions! # # ### 1 # In[1]: def stringMultiply(stringIn, number): return stringIn * number test1 = stringMultiply('hi', 5) test2 = stringMultiply('one', 2) print(test1, test2) # ### 2 # In[2]: def stringCompare(string1, string2): if len(string1) > len(string2): return string1 elif len(string2) > len(string1): return string2 else: return string1 + string2 test3 = stringCompare('hi', 'hiya') test4 = stringCompare('hi', 'ab') print(test3, test4) # In[3]: def stringFirstLast(stringIn, number): if number > len(stringIn): return "I'm sorry Dave, I can't do that." else: return stringIn[:number] + stringIn[-number:] test5 = stringFirstLast('purple', 2) test6 = stringFirstLast('hi', 2) test7 = stringFirstLast('hi', 3) print(test5, test6, test7) # ## Using functions to help us create awesome visualisations # # So hopefully you're feeling well-practised and ready to apply what we've learnt! # # In this lesson we'll explore a couple of different use cases for functions which we'll apply later in the course. # # ### Using functions to set the colour of a data item # # Colour is an incredibly important aspect of any visualisation. We can use colour to group different data together, or to set them apart. In this example, we'll write a function which will set the colour of a data item depending on it's value. This function is directly applicable to code which we'll write; you can set the colours in Plotly by using the colour names (as well as in many other ways too!). # # Have a go at writing the function yourself according to the specification below. If you get stuck, have a peek at the answer! Remember, there's always more than one solution, so don't take my version as the only way. If you code something and it works; great! # # ##### Write a function that takes two numbers as inputs. The first number is the value of the data item, and the second is the threshold at which we want the colour of that data item to change. The function should return 'Blue' if the first number is less than or equal to the second, and 'Red' otherwise. # # ```` # chooseColour(50, 60) --> 'Blue' # chooseColour(50, 40) --> 'Red' # ```` # In[4]: def chooseColour(value, threshold): if value <= threshold: return 'Blue' else: return 'Red' test1 = chooseColour(50,60) test2 = chooseColour(50,40) print(test1, test2) # ### What have we learnt this lesson? # In this lesson we've reviewed how to write functions. We did three practise functions to solidify the knowledge from the last lesson, and we also created two helper functions which we'll be able to reuse throughout the course. # If you have any questions, please ask in the comments section or email <a href="mailto:me@richard-muir.com">me@richard-muir.com</a>
def string_multiply(stringIn, number): return stringIn * number test1 = string_multiply('hi', 5) test2 = string_multiply('one', 2) print(test1, test2) def string_compare(string1, string2): if len(string1) > len(string2): return string1 elif len(string2) > len(string1): return string2 else: return string1 + string2 test3 = string_compare('hi', 'hiya') test4 = string_compare('hi', 'ab') print(test3, test4) def string_first_last(stringIn, number): if number > len(stringIn): return "I'm sorry Dave, I can't do that." else: return stringIn[:number] + stringIn[-number:] test5 = string_first_last('purple', 2) test6 = string_first_last('hi', 2) test7 = string_first_last('hi', 3) print(test5, test6, test7) def choose_colour(value, threshold): if value <= threshold: return 'Blue' else: return 'Red' test1 = choose_colour(50, 60) test2 = choose_colour(50, 40) print(test1, test2)
class config(): # env config render_train = True render_test = False env_name = "Pong-v0" overwrite_render = True record = True high = 255. # output config output_path = "results/test/" model_output = output_path + "model.weights/" log_path = output_path + "log.txt" plot_output = output_path + "scores.png" record_path = output_path + "video/" # model and training config num_episodes_test = 10 grad_clip = True clip_val = 10 saving_freq = 1000 log_freq = 50 eval_freq = 1000 record_freq = 1000 soft_epsilon = 0.05 # nature paper hyper params nsteps_train = 10000 batch_size = 32 buffer_size = 1000 target_update_freq = 1000 gamma = 0.99 learning_freq = 4 state_history = 4 skip_frame = 4 lr = 0.0001 eps_begin = 1 eps_end = 0.1 eps_nsteps = 1000 learning_start = 500
class Config: render_train = True render_test = False env_name = 'Pong-v0' overwrite_render = True record = True high = 255.0 output_path = 'results/test/' model_output = output_path + 'model.weights/' log_path = output_path + 'log.txt' plot_output = output_path + 'scores.png' record_path = output_path + 'video/' num_episodes_test = 10 grad_clip = True clip_val = 10 saving_freq = 1000 log_freq = 50 eval_freq = 1000 record_freq = 1000 soft_epsilon = 0.05 nsteps_train = 10000 batch_size = 32 buffer_size = 1000 target_update_freq = 1000 gamma = 0.99 learning_freq = 4 state_history = 4 skip_frame = 4 lr = 0.0001 eps_begin = 1 eps_end = 0.1 eps_nsteps = 1000 learning_start = 500
with open("sleepy.in") as input_file: input_file.readline() cows = list(map(int, input_file.readline().split())) def is_list_sorted(lst): return all(elem >= lst[index] for index, elem in enumerate(lst[1:])) t = 0 sorted_cows = cows.copy() for cow in cows: if is_list_sorted(sorted_cows): break if cow > sorted_cows[-1]: sorted_cows.remove(cow) sorted_cows.append(cow) else: i = len(cows) - 1 while cow < sorted_cows[i]: i -= 1 sorted_cows.remove(cow) sorted_cows.insert(i, cow) t += 1 with open("sleepy.out", "w") as output_file: output_file.write(str(t))
with open('sleepy.in') as input_file: input_file.readline() cows = list(map(int, input_file.readline().split())) def is_list_sorted(lst): return all((elem >= lst[index] for (index, elem) in enumerate(lst[1:]))) t = 0 sorted_cows = cows.copy() for cow in cows: if is_list_sorted(sorted_cows): break if cow > sorted_cows[-1]: sorted_cows.remove(cow) sorted_cows.append(cow) else: i = len(cows) - 1 while cow < sorted_cows[i]: i -= 1 sorted_cows.remove(cow) sorted_cows.insert(i, cow) t += 1 with open('sleepy.out', 'w') as output_file: output_file.write(str(t))
# Variable for registering new components # Add a new component here and define a file with the name <component_name>.py and override the main variables COMPONENTS = ["aggregations-spot", "gbdisagg-spot"]
components = ['aggregations-spot', 'gbdisagg-spot']
FEATURES = [ 'Post_Top_comment_Jaccard_sim', 'Post_Top_comment_topic_cosine_similarity', 'Post_text', 'Post_topic0', 'Post_topic1', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Top_comment_advice_count', 'Top_comment_agreement_value', 'Top_comment_and_Post_time_difference', 'Top_comment_author', 'Top_comment_author_gender_value', 'Top_comment_compliments_count', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_fundraising_URL_count', 'Top_comment_gratitude_count', 'Top_comment_hour', 'Top_comment_i_language_count', 'Top_comment_informative_URL_count', 'Top_comment_informative_count', 'Top_comment_laughter_count', 'Top_comment_link_count', 'Top_comment_mispellings', 'Top_comment_polarity', 'Top_comment_politeness_value', 'Top_comment_readability', 'Top_comment_score', 'Top_comment_subjectivity', 'Top_comment_subreddit', 'Top_comment_support_value', 'Top_comment_text', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_word_count' ] # 69 features ALBERT_META_FEATURES = [ 'Post_Top_comment_Jaccard_sim', 'Post_Top_comment_topic_cosine_similarity', 'Post_topic0', 'Post_topic1', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Top_comment_advice_count', 'Top_comment_agreement_value', 'Top_comment_and_Post_time_difference', 'Top_comment_author_gender_value', 'Top_comment_compliments_count', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_fundraising_URL_count', 'Top_comment_gratitude_count', 'Top_comment_hour', 'Top_comment_i_language_count', 'Top_comment_informative_URL_count', 'Top_comment_informative_count', 'Top_comment_laughter_count', 'Top_comment_link_count', 'Top_comment_mispellings', 'Top_comment_polarity', 'Top_comment_politeness_value', 'Top_comment_readability', 'Top_comment_score', 'Top_comment_subjectivity', 'Top_comment_support_value', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_word_count' ] # 65 features: it does not include 'Top_comment_author', 'Top_comment_subreddit', 'Top_comment_text', 'Post_text' XGBOOST_FEATURES = ['Top_comment_and_Post_time_difference', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_hour', 'Top_comment_link_count', 'Top_comment_score', 'Top_comment_mispellings', 'Top_comment_author_gender_value', 'Top_comment_agreement_value', 'Top_comment_support_value', 'Top_comment_politeness_value', 'Top_comment_informative_count', 'Top_comment_advice_count', 'Top_comment_laughter_count', 'Top_comment_gratitude_count', 'Top_comment_fundraising_URL_count', 'Top_comment_informative_URL_count', 'Top_comment_i_language_count', 'Top_comment_compliments_count', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Post_topic0', 'Post_topic1', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_Top_comment_topic_cosine_similarity', 'Post_Top_comment_Jaccard_sim', 'Top_comment_polarity', 'Top_comment_subjectivity', 'Top_comment_word_count', 'Top_comment_readability', 'Top_comment_unigram0', 'Top_comment_unigram1', 'Top_comment_unigram2', 'Top_comment_unigram3', 'Top_comment_unigram4', 'Top_comment_unigram5', 'Top_comment_unigram6', 'Top_comment_unigram7', 'Top_comment_unigram8', 'Top_comment_unigram9', 'Top_comment_unigram10', 'Top_comment_unigram11', 'Top_comment_unigram12', 'Top_comment_unigram13', 'Top_comment_unigram14', 'Top_comment_unigram15', 'Top_comment_unigram16', 'Top_comment_unigram17', 'Top_comment_unigram18', 'Top_comment_unigram19', 'Top_comment_unigram20', 'Top_comment_unigram21', 'Top_comment_unigram22', 'Top_comment_unigram23', 'Top_comment_unigram24', 'Top_comment_unigram25', 'Top_comment_unigram26', 'Top_comment_unigram27', 'Top_comment_unigram28', 'Top_comment_unigram29', 'Top_comment_unigram30', 'Top_comment_unigram31', 'Top_comment_unigram32', 'Top_comment_unigram33', 'Top_comment_unigram34', 'Top_comment_unigram35', 'Top_comment_unigram36', 'Top_comment_unigram37', 'Top_comment_unigram38', 'Top_comment_unigram39', 'Top_comment_unigram40', 'Top_comment_unigram41', 'Top_comment_unigram42', 'Top_comment_unigram43', 'Top_comment_unigram44', 'Top_comment_unigram45', 'Top_comment_unigram46', 'Top_comment_unigram47', 'Top_comment_unigram48', 'Top_comment_unigram49', 'Top_comment_unigram50', 'Top_comment_unigram51', 'Top_comment_unigram52', 'Top_comment_unigram53', 'Top_comment_unigram54', 'Top_comment_unigram55', 'Top_comment_unigram56', 'Top_comment_unigram57', 'Top_comment_unigram58', 'Top_comment_unigram59', 'Top_comment_unigram60', 'Top_comment_unigram61', 'Top_comment_unigram62', 'Top_comment_unigram63', 'Top_comment_unigram64', 'Top_comment_unigram65', 'Top_comment_unigram66', 'Top_comment_unigram67', 'Top_comment_unigram68', 'Top_comment_unigram69', 'Top_comment_unigram70', 'Top_comment_unigram71', 'Top_comment_unigram72', 'Top_comment_unigram73', 'Top_comment_unigram74', 'Top_comment_unigram75', 'Top_comment_unigram76', 'Top_comment_unigram77', 'Top_comment_unigram78', 'Top_comment_unigram79', 'Top_comment_unigram80', 'Top_comment_unigram81', 'Top_comment_unigram82', 'Top_comment_unigram83', 'Top_comment_unigram84', 'Top_comment_unigram85', 'Top_comment_unigram86', 'Top_comment_unigram87', 'Top_comment_unigram88', 'Top_comment_unigram89', 'Top_comment_unigram90', 'Top_comment_unigram91', 'Top_comment_unigram92', 'Top_comment_unigram93', 'Top_comment_unigram94', 'Top_comment_unigram95', 'Top_comment_unigram96', 'Top_comment_unigram97', 'Top_comment_unigram98', 'Top_comment_unigram99', 'Top_comment_unigram100', 'Top_comment_unigram101', 'Top_comment_unigram102', 'Top_comment_unigram103', 'Top_comment_unigram104', 'Top_comment_unigram105', 'Top_comment_unigram106', 'Top_comment_unigram107', 'Top_comment_unigram108', 'Top_comment_unigram109', 'Top_comment_unigram110', 'Top_comment_unigram111', 'Top_comment_unigram112', 'Top_comment_unigram113', 'Top_comment_unigram114', 'Top_comment_unigram115', 'Top_comment_unigram116', 'Top_comment_unigram117', 'Top_comment_unigram118', 'Top_comment_unigram119', 'Top_comment_unigram120', 'Top_comment_unigram121', 'Top_comment_unigram122', 'Top_comment_unigram123', 'Top_comment_unigram124', 'Top_comment_unigram125', 'Top_comment_unigram126', 'Top_comment_unigram127', 'Top_comment_unigram128', 'Top_comment_unigram129', 'Top_comment_unigram130', 'Top_comment_unigram131', 'Top_comment_unigram132', 'Top_comment_unigram133', 'Top_comment_unigram134', 'Top_comment_unigram135', 'Top_comment_unigram136', 'Top_comment_unigram137', 'Top_comment_unigram138', 'Top_comment_unigram139', 'Top_comment_unigram140', 'Top_comment_unigram141', 'Top_comment_unigram142', 'Top_comment_unigram143', 'Top_comment_unigram144', 'Top_comment_unigram145', 'Top_comment_unigram146', 'Top_comment_unigram147', 'Top_comment_unigram148', 'Top_comment_unigram149', 'Top_comment_unigram150', 'Top_comment_unigram151', 'Top_comment_unigram152', 'Top_comment_unigram153', 'Top_comment_unigram154', 'Top_comment_unigram155', 'Top_comment_unigram156', 'Top_comment_unigram157', 'Top_comment_unigram158', 'Top_comment_unigram159', 'Top_comment_unigram160', 'Top_comment_unigram161', 'Top_comment_unigram162', 'Top_comment_unigram163', 'Top_comment_unigram164', 'Top_comment_unigram165', 'Top_comment_unigram166', 'Top_comment_unigram167', 'Top_comment_unigram168', 'Top_comment_unigram169', 'Top_comment_unigram170', 'Top_comment_unigram171', 'Top_comment_unigram172', 'Top_comment_unigram173', 'Top_comment_unigram174', 'Top_comment_unigram175', 'Top_comment_unigram176', 'Top_comment_unigram177', 'Top_comment_unigram178', 'Top_comment_unigram179', 'Top_comment_unigram180', 'Top_comment_unigram181', 'Top_comment_unigram182', 'Top_comment_unigram183', 'Top_comment_unigram184', 'Top_comment_unigram185', 'Top_comment_unigram186', 'Top_comment_unigram187', 'Top_comment_unigram188', 'Top_comment_unigram189', 'Top_comment_unigram190', 'Top_comment_unigram191', 'Top_comment_unigram192', 'Top_comment_unigram193', 'Top_comment_unigram194', 'Top_comment_unigram195', 'Top_comment_unigram196', 'Top_comment_unigram197', 'Top_comment_unigram198', 'Top_comment_unigram199', 'Top_comment_unigram200', 'Top_comment_unigram201', 'Top_comment_unigram202', 'Top_comment_unigram203', 'Top_comment_unigram204', 'Top_comment_unigram205', 'Top_comment_unigram206', 'Top_comment_unigram207', 'Top_comment_unigram208', 'Top_comment_unigram209', 'Top_comment_unigram210', 'Top_comment_unigram211', 'Top_comment_unigram212', 'Top_comment_unigram213', 'Top_comment_unigram214', 'Top_comment_unigram215', 'Top_comment_unigram216', 'Top_comment_unigram217', 'Top_comment_unigram218', 'Top_comment_unigram219', 'Top_comment_unigram220', 'Top_comment_unigram221', 'Top_comment_unigram222', 'Top_comment_unigram223', 'Top_comment_unigram224', 'Top_comment_unigram225', 'Top_comment_unigram226', 'Top_comment_unigram227', 'Top_comment_unigram228', 'Top_comment_unigram229', 'Top_comment_unigram230', 'Top_comment_unigram231', 'Top_comment_unigram232', 'Top_comment_unigram233', 'Top_comment_unigram234', 'Top_comment_unigram235', 'Top_comment_unigram236', 'Top_comment_unigram237', 'Top_comment_unigram238', 'Top_comment_unigram239', 'Top_comment_unigram240', 'Top_comment_unigram241', 'Top_comment_unigram242', 'Top_comment_unigram243', 'Top_comment_unigram244', 'Top_comment_unigram245', 'Top_comment_unigram246', 'Top_comment_unigram247', 'Top_comment_unigram248', 'Top_comment_unigram249', 'Top_comment_unigram250', 'Top_comment_unigram251', 'Top_comment_unigram252', 'Top_comment_unigram253', 'Top_comment_unigram254', 'Top_comment_unigram255', 'Top_comment_unigram256', 'Top_comment_unigram257', 'Top_comment_unigram258', 'Top_comment_unigram259', 'Top_comment_unigram260', 'Top_comment_unigram261', 'Top_comment_unigram262', 'Top_comment_unigram263', 'Top_comment_unigram264', 'Top_comment_unigram265', 'Top_comment_unigram266', 'Top_comment_unigram267', 'Top_comment_unigram268', 'Top_comment_unigram269', 'Top_comment_unigram270', 'Top_comment_unigram271', 'Top_comment_unigram272', 'Top_comment_unigram273', 'Top_comment_unigram274', 'Top_comment_unigram275', 'Top_comment_unigram276', 'Top_comment_unigram277', 'Top_comment_unigram278', 'Top_comment_unigram279', 'Top_comment_unigram280', 'Top_comment_unigram281', 'Top_comment_unigram282', 'Top_comment_unigram283', 'Top_comment_unigram284', 'Top_comment_unigram285', 'Top_comment_unigram286', 'Top_comment_unigram287', 'Top_comment_unigram288', 'Top_comment_unigram289', 'Top_comment_unigram290', 'Top_comment_unigram291', 'Top_comment_unigram292', 'Top_comment_unigram293', 'Top_comment_unigram294', 'Top_comment_unigram295', 'Top_comment_unigram296', 'Top_comment_unigram297', 'Top_comment_unigram298', 'Top_comment_unigram299', 'Top_comment_unigram300', 'Top_comment_unigram301', 'Top_comment_unigram302', 'Top_comment_unigram303', 'Top_comment_unigram304', 'Top_comment_unigram305', 'Top_comment_unigram306', 'Top_comment_unigram307', 'Top_comment_unigram308', 'Top_comment_unigram309', 'Top_comment_unigram310', 'Top_comment_unigram311', 'Top_comment_unigram312', 'Top_comment_unigram313', 'Top_comment_unigram314', 'Top_comment_unigram315', 'Top_comment_unigram316', 'Top_comment_unigram317', 'Top_comment_unigram318', 'Top_comment_unigram319', 'Top_comment_unigram320', 'Top_comment_unigram321', 'Top_comment_unigram322', 'Top_comment_unigram323', 'Top_comment_unigram324', 'Top_comment_unigram325', 'Top_comment_unigram326', 'Top_comment_unigram327', 'Top_comment_unigram328', 'Top_comment_unigram329', 'Top_comment_unigram330', 'Top_comment_unigram331', 'Top_comment_unigram332', 'Top_comment_unigram333', 'Top_comment_unigram334', 'Top_comment_unigram335', 'Top_comment_unigram336', 'Top_comment_unigram337', 'Top_comment_unigram338', 'Top_comment_unigram339', 'Top_comment_unigram340', 'Top_comment_unigram341', 'Top_comment_unigram342', 'Top_comment_unigram343', 'Top_comment_unigram344', 'Top_comment_unigram345', 'Top_comment_unigram346', 'Top_comment_unigram347', 'Top_comment_unigram348', 'Top_comment_unigram349', 'Top_comment_unigram350', 'Top_comment_unigram351', 'Top_comment_unigram352', 'Top_comment_unigram353', 'Top_comment_unigram354', 'Top_comment_unigram355', 'Top_comment_unigram356', 'Top_comment_unigram357', 'Top_comment_unigram358', 'Top_comment_unigram359', 'Top_comment_unigram360', 'Top_comment_unigram361', 'Top_comment_unigram362', 'Top_comment_unigram363', 'Top_comment_unigram364', 'Top_comment_unigram365', 'Top_comment_unigram366', 'Top_comment_unigram367', 'Top_comment_unigram368', 'Top_comment_unigram369', 'Top_comment_unigram370', 'Top_comment_unigram371', 'Top_comment_unigram372', 'Top_comment_unigram373', 'Top_comment_unigram374', 'Top_comment_unigram375', 'Top_comment_unigram376', 'Top_comment_unigram377', 'Top_comment_unigram378', 'Top_comment_unigram379', 'Top_comment_unigram380', 'Top_comment_unigram381', 'Top_comment_unigram382', 'Top_comment_unigram383', 'Top_comment_unigram384', 'Top_comment_unigram385', 'Top_comment_unigram386', 'Top_comment_unigram387', 'Top_comment_unigram388', 'Top_comment_unigram389', 'Top_comment_unigram390', 'Top_comment_unigram391', 'Top_comment_unigram392', 'Top_comment_unigram393', 'Top_comment_unigram394', 'Top_comment_unigram395', 'Top_comment_unigram396', 'Top_comment_unigram397', 'Top_comment_unigram398', 'Top_comment_unigram399', 'Top_comment_unigram400', 'Top_comment_unigram401', 'Top_comment_unigram402', 'Top_comment_unigram403', 'Top_comment_unigram404', 'Top_comment_unigram405', 'Top_comment_unigram406', 'Top_comment_unigram407', 'Top_comment_unigram408', 'Top_comment_unigram409', 'Top_comment_unigram410', 'Top_comment_unigram411', 'Top_comment_unigram412', 'Top_comment_unigram413', 'Top_comment_unigram414', 'Top_comment_unigram415', 'Top_comment_unigram416', 'Top_comment_unigram417', 'Top_comment_unigram418', 'Top_comment_unigram419', 'Top_comment_unigram420', 'Top_comment_unigram421', 'Top_comment_unigram422', 'Top_comment_unigram423', 'Top_comment_unigram424', 'Top_comment_unigram425', 'Top_comment_unigram426', 'Top_comment_unigram427', 'Top_comment_unigram428', 'Top_comment_unigram429', 'Top_comment_unigram430', 'Top_comment_unigram431', 'Top_comment_unigram432', 'Top_comment_unigram433', 'Top_comment_unigram434', 'Top_comment_unigram435', 'Top_comment_unigram436', 'Top_comment_unigram437', 'Top_comment_unigram438', 'Top_comment_unigram439', 'Top_comment_unigram440', 'Top_comment_unigram441', 'Top_comment_unigram442', 'Top_comment_unigram443', 'Top_comment_unigram444', 'Top_comment_unigram445', 'Top_comment_unigram446', 'Top_comment_unigram447', 'Top_comment_unigram448', 'Top_comment_unigram449', 'Top_comment_unigram450', 'Top_comment_unigram451', 'Top_comment_unigram452', 'Top_comment_unigram453', 'Top_comment_unigram454', 'Top_comment_unigram455', 'Top_comment_unigram456', 'Top_comment_unigram457', 'Top_comment_unigram458', 'Top_comment_unigram459', 'Top_comment_unigram460', 'Top_comment_unigram461', 'Top_comment_unigram462', 'Top_comment_unigram463', 'Top_comment_unigram464', 'Top_comment_unigram465', 'Top_comment_unigram466', 'Top_comment_unigram467', 'Top_comment_unigram468', 'Top_comment_unigram469', 'Top_comment_unigram470', 'Top_comment_unigram471', 'Top_comment_unigram472', 'Top_comment_unigram473', 'Top_comment_unigram474', 'Top_comment_unigram475', 'Top_comment_unigram476', 'Top_comment_unigram477', 'Top_comment_unigram478', 'Top_comment_unigram479', 'Top_comment_unigram480', 'Top_comment_unigram481', 'Top_comment_unigram482', 'Top_comment_unigram483', 'Top_comment_unigram484', 'Top_comment_unigram485', 'Top_comment_unigram486', 'Top_comment_unigram487', 'Top_comment_unigram488', 'Top_comment_unigram489', 'Top_comment_unigram490', 'Top_comment_unigram491', 'Top_comment_unigram492', 'Top_comment_unigram493', 'Top_comment_unigram494', 'Top_comment_unigram495', 'Top_comment_unigram496', 'Top_comment_unigram497', 'Top_comment_unigram498', 'Top_comment_unigram499', 'Top_comment_unigram500', 'Top_comment_unigram501', 'Top_comment_unigram502', 'Top_comment_unigram503', 'Top_comment_unigram504', 'Top_comment_unigram505', 'Top_comment_unigram506', 'Top_comment_unigram507', 'Top_comment_unigram508', 'Top_comment_unigram509', 'Top_comment_unigram510', 'Top_comment_unigram511', 'Top_comment_unigram512', 'Top_comment_unigram513', 'Top_comment_unigram514', 'Top_comment_unigram515', 'Top_comment_unigram516', 'Top_comment_unigram517', 'Top_comment_unigram518', 'Top_comment_unigram519', 'Top_comment_unigram520', 'Top_comment_unigram521', 'Top_comment_unigram522', 'Top_comment_unigram523', 'Top_comment_unigram524', 'Top_comment_unigram525', 'Top_comment_unigram526', 'Top_comment_unigram527', 'Top_comment_unigram528', 'Top_comment_unigram529', 'Top_comment_unigram530', 'Top_comment_unigram531', 'Top_comment_unigram532', 'Top_comment_unigram533', 'Top_comment_unigram534', 'Top_comment_unigram535', 'Top_comment_unigram536', 'Top_comment_unigram537', 'Top_comment_unigram538', 'Top_comment_unigram539', 'Top_comment_unigram540', 'Top_comment_unigram541', 'Top_comment_unigram542', 'Top_comment_unigram543', 'Top_comment_unigram544', 'Top_comment_unigram545', 'Top_comment_unigram546', 'Top_comment_unigram547', 'Top_comment_unigram548', 'Top_comment_unigram549', 'Top_comment_unigram550', 'Top_comment_unigram551', 'Top_comment_unigram552', 'Top_comment_unigram553', 'Top_comment_unigram554', 'Top_comment_unigram555', 'Top_comment_unigram556', 'Top_comment_unigram557', 'Top_comment_unigram558', 'Top_comment_unigram559', 'Top_comment_unigram560', 'Top_comment_unigram561', 'Top_comment_unigram562', 'Top_comment_unigram563', 'Top_comment_unigram564', 'Top_comment_unigram565', 'Top_comment_unigram566', 'Top_comment_unigram567', 'Top_comment_unigram568', 'Top_comment_unigram569', 'Top_comment_unigram570', 'Top_comment_unigram571', 'Top_comment_unigram572', 'Top_comment_unigram573', 'Top_comment_unigram574', 'Top_comment_unigram575', 'Top_comment_unigram576', 'Top_comment_unigram577', 'Top_comment_unigram578', 'Top_comment_unigram579', 'Top_comment_unigram580', 'Top_comment_unigram581', 'Top_comment_unigram582', 'Top_comment_unigram583', 'Top_comment_unigram584', 'Top_comment_unigram585', 'Top_comment_unigram586', 'Top_comment_unigram587', 'Top_comment_unigram588', 'Top_comment_unigram589', 'Top_comment_unigram590', 'Top_comment_unigram591', 'Top_comment_unigram592', 'Top_comment_unigram593', 'Top_comment_unigram594', 'Top_comment_unigram595', 'Top_comment_unigram596', 'Top_comment_unigram597', 'Top_comment_unigram598', 'Top_comment_unigram599', 'Top_comment_unigram600', 'Top_comment_unigram601', 'Top_comment_unigram602', 'Top_comment_unigram603', 'Top_comment_unigram604', 'Top_comment_unigram605', 'Top_comment_unigram606', 'Top_comment_unigram607', 'Top_comment_unigram608', 'Top_comment_unigram609', 'Top_comment_unigram610', 'Top_comment_unigram611', 'Top_comment_unigram612', 'Top_comment_unigram613', 'Top_comment_unigram614', 'Top_comment_unigram615', 'Top_comment_unigram616', 'Top_comment_unigram617', 'Top_comment_unigram618', 'Top_comment_unigram619', 'Top_comment_unigram620', 'Top_comment_unigram621', 'Top_comment_unigram622', 'Top_comment_unigram623', 'Top_comment_unigram624', 'Top_comment_unigram625', 'Top_comment_unigram626', 'Top_comment_unigram627', 'Top_comment_unigram628', 'Top_comment_unigram629', 'Top_comment_unigram630', 'Top_comment_unigram631', 'Top_comment_unigram632', 'Top_comment_unigram633', 'Top_comment_unigram634', 'Top_comment_unigram635', 'Top_comment_unigram636', 'Top_comment_unigram637', 'Top_comment_unigram638', 'Top_comment_unigram639', 'Top_comment_unigram640', 'Top_comment_unigram641', 'Top_comment_unigram642', 'Top_comment_unigram643', 'Top_comment_unigram644', 'Top_comment_unigram645', 'Top_comment_unigram646', 'Top_comment_unigram647', 'Top_comment_unigram648', 'Top_comment_unigram649', 'Top_comment_unigram650', 'Top_comment_unigram651', 'Top_comment_unigram652', 'Top_comment_unigram653', 'Top_comment_unigram654', 'Top_comment_unigram655', 'Top_comment_unigram656', 'Top_comment_unigram657', 'Top_comment_unigram658', 'Top_comment_unigram659', 'Top_comment_unigram660', 'Top_comment_unigram661', 'Top_comment_unigram662', 'Top_comment_unigram663', 'Top_comment_unigram664', 'Top_comment_unigram665', 'Top_comment_unigram666', 'Top_comment_unigram667', 'Top_comment_unigram668', 'Top_comment_unigram669', 'Top_comment_unigram670', 'Top_comment_unigram671', 'Top_comment_unigram672', 'Top_comment_unigram673', 'Top_comment_unigram674', 'Top_comment_unigram675', 'Top_comment_unigram676', 'Top_comment_unigram677', 'Top_comment_unigram678', 'Top_comment_unigram679', 'Top_comment_unigram680', 'Top_comment_unigram681', 'Top_comment_unigram682', 'Top_comment_unigram683', 'Top_comment_unigram684', 'Top_comment_unigram685', 'Top_comment_unigram686', 'Top_comment_unigram687', 'Top_comment_unigram688', 'Top_comment_unigram689', 'Top_comment_unigram690', 'Top_comment_unigram691', 'Top_comment_unigram692', 'Top_comment_unigram693', 'Top_comment_unigram694', 'Top_comment_unigram695', 'Top_comment_unigram696', 'Top_comment_unigram697', 'Top_comment_unigram698', 'Top_comment_unigram699', 'Top_comment_unigram700', 'Top_comment_unigram701', 'Top_comment_unigram702', 'Top_comment_unigram703', 'Top_comment_unigram704', 'Top_comment_unigram705', 'Top_comment_unigram706', 'Top_comment_unigram707', 'Top_comment_unigram708', 'Top_comment_unigram709', 'Top_comment_unigram710', 'Top_comment_unigram711', 'Top_comment_unigram712', 'Top_comment_unigram713', 'Top_comment_unigram714', 'Top_comment_unigram715', 'Top_comment_unigram716', 'Top_comment_unigram717', 'Top_comment_unigram718', 'Top_comment_unigram719', 'Top_comment_unigram720', 'Top_comment_unigram721', 'Top_comment_unigram722', 'Top_comment_unigram723', 'Top_comment_unigram724', 'Top_comment_unigram725', 'Top_comment_unigram726', 'Top_comment_unigram727', 'Top_comment_unigram728', 'Top_comment_unigram729', 'Top_comment_unigram730', 'Top_comment_unigram731', 'Top_comment_unigram732', 'Top_comment_unigram733', 'Top_comment_unigram734', 'Top_comment_unigram735', 'Top_comment_unigram736', 'Top_comment_unigram737', 'Top_comment_unigram738', 'Top_comment_unigram739', 'Top_comment_unigram740', 'Top_comment_unigram741', 'Top_comment_unigram742', 'Top_comment_unigram743', 'Top_comment_unigram744', 'Top_comment_unigram745', 'Top_comment_unigram746', 'Top_comment_unigram747', 'Top_comment_unigram748', 'Top_comment_unigram749', 'Top_comment_unigram750', 'Top_comment_unigram751', 'Top_comment_unigram752', 'Top_comment_unigram753', 'Top_comment_unigram754', 'Top_comment_unigram755', 'Top_comment_unigram756', 'Top_comment_unigram757', 'Top_comment_unigram758', 'Top_comment_unigram759', 'Top_comment_unigram760', 'Top_comment_unigram761', 'Top_comment_unigram762', 'Top_comment_unigram763', 'Top_comment_unigram764', 'Top_comment_unigram765', 'Top_comment_unigram766', 'Top_comment_unigram767', 'Top_comment_unigram768', 'Top_comment_unigram769', 'Top_comment_unigram770', 'Top_comment_unigram771', 'Top_comment_unigram772', 'Top_comment_unigram773', 'Top_comment_unigram774', 'Top_comment_unigram775', 'Top_comment_unigram776', 'Top_comment_unigram777', 'Top_comment_unigram778', 'Top_comment_unigram779', 'Top_comment_unigram780', 'Top_comment_unigram781', 'Top_comment_unigram782', 'Top_comment_unigram783', 'Top_comment_unigram784', 'Top_comment_unigram785', 'Top_comment_unigram786', 'Top_comment_unigram787', 'Top_comment_unigram788', 'Top_comment_unigram789', 'Top_comment_unigram790', 'Top_comment_unigram791', 'Top_comment_unigram792', 'Top_comment_unigram793', 'Top_comment_unigram794', 'Top_comment_unigram795', 'Top_comment_unigram796', 'Top_comment_unigram797', 'Top_comment_unigram798', 'Top_comment_unigram799', 'Top_comment_unigram800', 'Top_comment_unigram801', 'Top_comment_unigram802', 'Top_comment_unigram803', 'Top_comment_unigram804', 'Top_comment_unigram805', 'Top_comment_unigram806', 'Top_comment_unigram807', 'Top_comment_unigram808', 'Top_comment_unigram809', 'Top_comment_unigram810', 'Top_comment_unigram811', 'Top_comment_unigram812', 'Top_comment_unigram813', 'Top_comment_unigram814', 'Top_comment_unigram815', 'Top_comment_unigram816', 'Top_comment_unigram817', 'Top_comment_unigram818', 'Top_comment_unigram819', 'Top_comment_unigram820', 'Top_comment_unigram821', 'Top_comment_unigram822', 'Top_comment_unigram823', 'Top_comment_unigram824', 'Top_comment_unigram825', 'Top_comment_unigram826', 'Top_comment_unigram827', 'Top_comment_unigram828', 'Top_comment_unigram829', 'Top_comment_unigram830', 'Top_comment_unigram831', 'Top_comment_unigram832', 'Top_comment_unigram833', 'Top_comment_unigram834', 'Top_comment_unigram835', 'Top_comment_unigram836', 'Top_comment_unigram837', 'Top_comment_unigram838', 'Top_comment_unigram839', 'Top_comment_unigram840', 'Top_comment_unigram841', 'Top_comment_unigram842', 'Top_comment_unigram843', 'Top_comment_unigram844', 'Top_comment_unigram845', 'Top_comment_unigram846', 'Top_comment_unigram847', 'Top_comment_unigram848', 'Top_comment_unigram849', 'Top_comment_unigram850', 'Top_comment_unigram851', 'Top_comment_unigram852', 'Top_comment_unigram853', 'Top_comment_unigram854', 'Top_comment_unigram855', 'Top_comment_unigram856', 'Top_comment_unigram857', 'Top_comment_unigram858', 'Top_comment_unigram859', 'Top_comment_unigram860', 'Top_comment_unigram861', 'Top_comment_unigram862', 'Top_comment_unigram863', 'Top_comment_unigram864', 'Top_comment_unigram865', 'Top_comment_unigram866', 'Top_comment_unigram867', 'Top_comment_unigram868', 'Top_comment_unigram869', 'Top_comment_unigram870', 'Top_comment_unigram871', 'Top_comment_unigram872', 'Top_comment_unigram873', 'Top_comment_unigram874', 'Top_comment_unigram875', 'Top_comment_unigram876', 'Top_comment_unigram877', 'Top_comment_unigram878', 'Top_comment_unigram879', 'Top_comment_unigram880', 'Top_comment_unigram881', 'Top_comment_unigram882', 'Top_comment_unigram883', 'Top_comment_unigram884', 'Top_comment_unigram885', 'Top_comment_unigram886', 'Top_comment_unigram887', 'Top_comment_unigram888', 'Top_comment_unigram889', 'Top_comment_unigram890', 'Top_comment_unigram891', 'Top_comment_unigram892', 'Top_comment_unigram893', 'Top_comment_unigram894', 'Top_comment_unigram895', 'Top_comment_unigram896', 'Top_comment_unigram897', 'Top_comment_unigram898', 'Top_comment_unigram899', 'Top_comment_unigram900', 'Top_comment_unigram901', 'Top_comment_unigram902', 'Top_comment_unigram903', 'Top_comment_unigram904', 'Top_comment_unigram905', 'Top_comment_unigram906', 'Top_comment_unigram907', 'Top_comment_unigram908', 'Top_comment_unigram909', 'Top_comment_unigram910', 'Top_comment_unigram911', 'Top_comment_unigram912', 'Top_comment_unigram913', 'Top_comment_unigram914', 'Top_comment_unigram915', 'Top_comment_unigram916', 'Top_comment_unigram917', 'Top_comment_unigram918', 'Top_comment_unigram919', 'Top_comment_unigram920', 'Top_comment_unigram921', 'Top_comment_unigram922', 'Top_comment_unigram923', 'Top_comment_unigram924', 'Top_comment_unigram925', 'Top_comment_unigram926', 'Top_comment_unigram927', 'Top_comment_unigram928', 'Top_comment_unigram929', 'Top_comment_unigram930', 'Top_comment_unigram931', 'Top_comment_unigram932', 'Top_comment_unigram933', 'Top_comment_unigram934', 'Top_comment_unigram935', 'Top_comment_unigram936', 'Top_comment_unigram937', 'Top_comment_unigram938', 'Top_comment_unigram939', 'Top_comment_unigram940', 'Top_comment_unigram941', 'Top_comment_unigram942', 'Top_comment_unigram943', 'Top_comment_unigram944', 'Top_comment_unigram945', 'Top_comment_unigram946', 'Top_comment_unigram947', 'Top_comment_unigram948', 'Top_comment_unigram949', 'Top_comment_unigram950', 'Top_comment_unigram951', 'Top_comment_unigram952', 'Top_comment_unigram953', 'Top_comment_unigram954', 'Top_comment_unigram955', 'Top_comment_unigram956', 'Top_comment_unigram957', 'Top_comment_unigram958', 'Top_comment_unigram959', 'Top_comment_unigram960', 'Top_comment_unigram961', 'Top_comment_unigram962', 'Top_comment_unigram963', 'Top_comment_unigram964', 'Top_comment_unigram965', 'Top_comment_unigram966', 'Top_comment_unigram967', 'Top_comment_unigram968', 'Top_comment_unigram969', 'Top_comment_unigram970', 'Top_comment_unigram971', 'Top_comment_unigram972', 'Top_comment_unigram973', 'Top_comment_unigram974', 'Top_comment_unigram975', 'Top_comment_unigram976', 'Top_comment_unigram977', 'Top_comment_unigram978', 'Top_comment_unigram979', 'Top_comment_unigram980', 'Top_comment_unigram981', 'Top_comment_unigram982', 'Top_comment_unigram983', 'Top_comment_unigram984', 'Top_comment_unigram985', 'Top_comment_unigram986', 'Top_comment_unigram987', 'Top_comment_unigram988', 'Top_comment_unigram989', 'Top_comment_unigram990', 'Top_comment_unigram991', 'Top_comment_unigram992', 'Top_comment_unigram993', 'Top_comment_unigram994', 'Top_comment_unigram995', 'Top_comment_unigram996', 'Top_comment_unigram997', 'Top_comment_unigram998', 'Top_comment_unigram999', 'Top_comment_bigram0', 'Top_comment_bigram1', 'Top_comment_bigram2', 'Top_comment_bigram3', 'Top_comment_bigram4', 'Top_comment_bigram5', 'Top_comment_bigram6', 'Top_comment_bigram7', 'Top_comment_bigram8', 'Top_comment_bigram9', 'Top_comment_bigram10', 'Top_comment_bigram11', 'Top_comment_bigram12', 'Top_comment_bigram13', 'Top_comment_bigram14', 'Top_comment_bigram15', 'Top_comment_bigram16', 'Top_comment_bigram17', 'Top_comment_bigram18', 'Top_comment_bigram19', 'Top_comment_bigram20', 'Top_comment_bigram21', 'Top_comment_bigram22', 'Top_comment_bigram23', 'Top_comment_bigram24', 'Top_comment_bigram25', 'Top_comment_bigram26', 'Top_comment_bigram27', 'Top_comment_bigram28', 'Top_comment_bigram29', 'Top_comment_bigram30', 'Top_comment_bigram31', 'Top_comment_bigram32', 'Top_comment_bigram33', 'Top_comment_bigram34', 'Top_comment_bigram35', 'Top_comment_bigram36', 'Top_comment_bigram37', 'Top_comment_bigram38', 'Top_comment_bigram39', 'Top_comment_bigram40', 'Top_comment_bigram41', 'Top_comment_bigram42', 'Top_comment_bigram43', 'Top_comment_bigram44', 'Top_comment_bigram45', 'Top_comment_bigram46', 'Top_comment_bigram47', 'Top_comment_bigram48', 'Top_comment_bigram49', 'Top_comment_bigram50', 'Top_comment_bigram51', 'Top_comment_bigram52', 'Top_comment_bigram53', 'Top_comment_bigram54', 'Top_comment_bigram55', 'Top_comment_bigram56', 'Top_comment_bigram57', 'Top_comment_bigram58', 'Top_comment_bigram59', 'Top_comment_bigram60', 'Top_comment_bigram61', 'Top_comment_bigram62', 'Top_comment_bigram63', 'Top_comment_bigram64', 'Top_comment_bigram65', 'Top_comment_bigram66', 'Top_comment_bigram67', 'Top_comment_bigram68', 'Top_comment_bigram69', 'Top_comment_bigram70', 'Top_comment_bigram71', 'Top_comment_bigram72', 'Top_comment_bigram73', 'Top_comment_bigram74', 'Top_comment_bigram75', 'Top_comment_bigram76', 'Top_comment_bigram77', 'Top_comment_bigram78', 'Top_comment_bigram79', 'Top_comment_bigram80', 'Top_comment_bigram81', 'Top_comment_bigram82', 'Top_comment_bigram83', 'Top_comment_bigram84', 'Top_comment_bigram85', 'Top_comment_bigram86', 'Top_comment_bigram87', 'Top_comment_bigram88', 'Top_comment_bigram89', 'Top_comment_bigram90', 'Top_comment_bigram91', 'Top_comment_bigram92', 'Top_comment_bigram93', 'Top_comment_bigram94', 'Top_comment_bigram95', 'Top_comment_bigram96', 'Top_comment_bigram97', 'Top_comment_bigram98', 'Top_comment_bigram99', 'Top_comment_bigram100', 'Top_comment_bigram101', 'Top_comment_bigram102', 'Top_comment_bigram103', 'Top_comment_bigram104', 'Top_comment_bigram105', 'Top_comment_bigram106', 'Top_comment_bigram107', 'Top_comment_bigram108', 'Top_comment_bigram109', 'Top_comment_bigram110', 'Top_comment_bigram111', 'Top_comment_bigram112', 'Top_comment_bigram113', 'Top_comment_bigram114', 'Top_comment_bigram115', 'Top_comment_bigram116', 'Top_comment_bigram117', 'Top_comment_bigram118', 'Top_comment_bigram119', 'Top_comment_bigram120', 'Top_comment_bigram121', 'Top_comment_bigram122', 'Top_comment_bigram123', 'Top_comment_bigram124', 'Top_comment_bigram125', 'Top_comment_bigram126', 'Top_comment_bigram127', 'Top_comment_bigram128', 'Top_comment_bigram129', 'Top_comment_bigram130', 'Top_comment_bigram131', 'Top_comment_bigram132', 'Top_comment_bigram133', 'Top_comment_bigram134', 'Top_comment_bigram135', 'Top_comment_bigram136', 'Top_comment_bigram137', 'Top_comment_bigram138', 'Top_comment_bigram139', 'Top_comment_bigram140', 'Top_comment_bigram141', 'Top_comment_bigram142', 'Top_comment_bigram143', 'Top_comment_bigram144', 'Top_comment_bigram145', 'Top_comment_bigram146', 'Top_comment_bigram147', 'Top_comment_bigram148', 'Top_comment_bigram149', 'Top_comment_bigram150', 'Top_comment_bigram151', 'Top_comment_bigram152', 'Top_comment_bigram153', 'Top_comment_bigram154', 'Top_comment_bigram155', 'Top_comment_bigram156', 'Top_comment_bigram157', 'Top_comment_bigram158', 'Top_comment_bigram159', 'Top_comment_bigram160', 'Top_comment_bigram161', 'Top_comment_bigram162', 'Top_comment_bigram163', 'Top_comment_bigram164', 'Top_comment_bigram165', 'Top_comment_bigram166', 'Top_comment_bigram167', 'Top_comment_bigram168', 'Top_comment_bigram169', 'Top_comment_bigram170', 'Top_comment_bigram171', 'Top_comment_bigram172', 'Top_comment_bigram173', 'Top_comment_bigram174', 'Top_comment_bigram175', 'Top_comment_bigram176', 'Top_comment_bigram177', 'Top_comment_bigram178', 'Top_comment_bigram179', 'Top_comment_bigram180', 'Top_comment_bigram181', 'Top_comment_bigram182', 'Top_comment_bigram183', 'Top_comment_bigram184', 'Top_comment_bigram185', 'Top_comment_bigram186', 'Top_comment_bigram187', 'Top_comment_bigram188', 'Top_comment_bigram189', 'Top_comment_bigram190', 'Top_comment_bigram191', 'Top_comment_bigram192', 'Top_comment_bigram193', 'Top_comment_bigram194', 'Top_comment_bigram195', 'Top_comment_bigram196', 'Top_comment_bigram197', 'Top_comment_bigram198', 'Top_comment_bigram199', 'Top_comment_bigram200', 'Top_comment_bigram201', 'Top_comment_bigram202', 'Top_comment_bigram203', 'Top_comment_bigram204', 'Top_comment_bigram205', 'Top_comment_bigram206', 'Top_comment_bigram207', 'Top_comment_bigram208', 'Top_comment_bigram209', 'Top_comment_bigram210', 'Top_comment_bigram211', 'Top_comment_bigram212', 'Top_comment_bigram213', 'Top_comment_bigram214', 'Top_comment_bigram215', 'Top_comment_bigram216', 'Top_comment_bigram217', 'Top_comment_bigram218', 'Top_comment_bigram219', 'Top_comment_bigram220', 'Top_comment_bigram221', 'Top_comment_bigram222', 'Top_comment_bigram223', 'Top_comment_bigram224', 'Top_comment_bigram225', 'Top_comment_bigram226', 'Top_comment_bigram227', 'Top_comment_bigram228', 'Top_comment_bigram229', 'Top_comment_bigram230', 'Top_comment_bigram231', 'Top_comment_bigram232', 'Top_comment_bigram233', 'Top_comment_bigram234', 'Top_comment_bigram235', 'Top_comment_bigram236', 'Top_comment_bigram237', 'Top_comment_bigram238', 'Top_comment_bigram239', 'Top_comment_bigram240', 'Top_comment_bigram241', 'Top_comment_bigram242', 'Top_comment_bigram243', 'Top_comment_bigram244', 'Top_comment_bigram245', 'Top_comment_bigram246', 'Top_comment_bigram247', 'Top_comment_bigram248', 'Top_comment_bigram249', 'Top_comment_bigram250', 'Top_comment_bigram251', 'Top_comment_bigram252', 'Top_comment_bigram253', 'Top_comment_bigram254', 'Top_comment_bigram255', 'Top_comment_bigram256', 'Top_comment_bigram257', 'Top_comment_bigram258', 'Top_comment_bigram259', 'Top_comment_bigram260', 'Top_comment_bigram261', 'Top_comment_bigram262', 'Top_comment_bigram263', 'Top_comment_bigram264', 'Top_comment_bigram265', 'Top_comment_bigram266', 'Top_comment_bigram267', 'Top_comment_bigram268', 'Top_comment_bigram269', 'Top_comment_bigram270', 'Top_comment_bigram271', 'Top_comment_bigram272', 'Top_comment_bigram273', 'Top_comment_bigram274', 'Top_comment_bigram275', 'Top_comment_bigram276', 'Top_comment_bigram277', 'Top_comment_bigram278', 'Top_comment_bigram279', 'Top_comment_bigram280', 'Top_comment_bigram281', 'Top_comment_bigram282', 'Top_comment_bigram283', 'Top_comment_bigram284', 'Top_comment_bigram285', 'Top_comment_bigram286', 'Top_comment_bigram287', 'Top_comment_bigram288', 'Top_comment_bigram289', 'Top_comment_bigram290', 'Top_comment_bigram291', 'Top_comment_bigram292', 'Top_comment_bigram293', 'Top_comment_bigram294', 'Top_comment_bigram295', 'Top_comment_bigram296', 'Top_comment_bigram297', 'Top_comment_bigram298', 'Top_comment_bigram299', 'Top_comment_bigram300', 'Top_comment_bigram301', 'Top_comment_bigram302', 'Top_comment_bigram303', 'Top_comment_bigram304', 'Top_comment_bigram305', 'Top_comment_bigram306', 'Top_comment_bigram307', 'Top_comment_bigram308', 'Top_comment_bigram309', 'Top_comment_bigram310', 'Top_comment_bigram311', 'Top_comment_bigram312', 'Top_comment_bigram313', 'Top_comment_bigram314', 'Top_comment_bigram315', 'Top_comment_bigram316', 'Top_comment_bigram317', 'Top_comment_bigram318', 'Top_comment_bigram319', 'Top_comment_bigram320', 'Top_comment_bigram321', 'Top_comment_bigram322', 'Top_comment_bigram323', 'Top_comment_bigram324', 'Top_comment_bigram325', 'Top_comment_bigram326', 'Top_comment_bigram327', 'Top_comment_bigram328', 'Top_comment_bigram329', 'Top_comment_bigram330', 'Top_comment_bigram331', 'Top_comment_bigram332', 'Top_comment_bigram333', 'Top_comment_bigram334', 'Top_comment_bigram335', 'Top_comment_bigram336', 'Top_comment_bigram337', 'Top_comment_bigram338', 'Top_comment_bigram339', 'Top_comment_bigram340', 'Top_comment_bigram341', 'Top_comment_bigram342', 'Top_comment_bigram343', 'Top_comment_bigram344', 'Top_comment_bigram345', 'Top_comment_bigram346', 'Top_comment_bigram347', 'Top_comment_bigram348', 'Top_comment_bigram349', 'Top_comment_bigram350', 'Top_comment_bigram351', 'Top_comment_bigram352', 'Top_comment_bigram353', 'Top_comment_bigram354', 'Top_comment_bigram355', 'Top_comment_bigram356', 'Top_comment_bigram357', 'Top_comment_bigram358', 'Top_comment_bigram359', 'Top_comment_bigram360', 'Top_comment_bigram361', 'Top_comment_bigram362', 'Top_comment_bigram363', 'Top_comment_bigram364', 'Top_comment_bigram365', 'Top_comment_bigram366', 'Top_comment_bigram367', 'Top_comment_bigram368', 'Top_comment_bigram369', 'Top_comment_bigram370', 'Top_comment_bigram371', 'Top_comment_bigram372', 'Top_comment_bigram373', 'Top_comment_bigram374', 'Top_comment_bigram375', 'Top_comment_bigram376', 'Top_comment_bigram377', 'Top_comment_bigram378', 'Top_comment_bigram379', 'Top_comment_bigram380', 'Top_comment_bigram381', 'Top_comment_bigram382', 'Top_comment_bigram383', 'Top_comment_bigram384', 'Top_comment_bigram385', 'Top_comment_bigram386', 'Top_comment_bigram387', 'Top_comment_bigram388', 'Top_comment_bigram389', 'Top_comment_bigram390', 'Top_comment_bigram391', 'Top_comment_bigram392', 'Top_comment_bigram393', 'Top_comment_bigram394', 'Top_comment_bigram395', 'Top_comment_bigram396', 'Top_comment_bigram397', 'Top_comment_bigram398', 'Top_comment_bigram399', 'Top_comment_bigram400', 'Top_comment_bigram401', 'Top_comment_bigram402', 'Top_comment_bigram403', 'Top_comment_bigram404', 'Top_comment_bigram405', 'Top_comment_bigram406', 'Top_comment_bigram407', 'Top_comment_bigram408', 'Top_comment_bigram409', 'Top_comment_bigram410', 'Top_comment_bigram411', 'Top_comment_bigram412', 'Top_comment_bigram413', 'Top_comment_bigram414', 'Top_comment_bigram415', 'Top_comment_bigram416', 'Top_comment_bigram417', 'Top_comment_bigram418', 'Top_comment_bigram419', 'Top_comment_bigram420', 'Top_comment_bigram421', 'Top_comment_bigram422', 'Top_comment_bigram423', 'Top_comment_bigram424', 'Top_comment_bigram425', 'Top_comment_bigram426', 'Top_comment_bigram427', 'Top_comment_bigram428', 'Top_comment_bigram429', 'Top_comment_bigram430', 'Top_comment_bigram431', 'Top_comment_bigram432', 'Top_comment_bigram433', 'Top_comment_bigram434', 'Top_comment_bigram435', 'Top_comment_bigram436', 'Top_comment_bigram437', 'Top_comment_bigram438', 'Top_comment_bigram439', 'Top_comment_bigram440', 'Top_comment_bigram441', 'Top_comment_bigram442', 'Top_comment_bigram443', 'Top_comment_bigram444', 'Top_comment_bigram445', 'Top_comment_bigram446', 'Top_comment_bigram447', 'Top_comment_bigram448', 'Top_comment_bigram449', 'Top_comment_bigram450', 'Top_comment_bigram451', 'Top_comment_bigram452', 'Top_comment_bigram453', 'Top_comment_bigram454', 'Top_comment_bigram455', 'Top_comment_bigram456', 'Top_comment_bigram457', 'Top_comment_bigram458', 'Top_comment_bigram459', 'Top_comment_bigram460', 'Top_comment_bigram461', 'Top_comment_bigram462', 'Top_comment_bigram463', 'Top_comment_bigram464', 'Top_comment_bigram465', 'Top_comment_bigram466', 'Top_comment_bigram467', 'Top_comment_bigram468', 'Top_comment_bigram469', 'Top_comment_bigram470', 'Top_comment_bigram471', 'Top_comment_bigram472', 'Top_comment_bigram473', 'Top_comment_bigram474', 'Top_comment_bigram475', 'Top_comment_bigram476', 'Top_comment_bigram477', 'Top_comment_bigram478', 'Top_comment_bigram479', 'Top_comment_bigram480', 'Top_comment_bigram481', 'Top_comment_bigram482', 'Top_comment_bigram483', 'Top_comment_bigram484', 'Top_comment_bigram485', 'Top_comment_bigram486', 'Top_comment_bigram487', 'Top_comment_bigram488', 'Top_comment_bigram489', 'Top_comment_bigram490', 'Top_comment_bigram491', 'Top_comment_bigram492', 'Top_comment_bigram493', 'Top_comment_bigram494', 'Top_comment_bigram495', 'Top_comment_bigram496', 'Top_comment_bigram497', 'Top_comment_bigram498', 'Top_comment_bigram499', 'Top_comment_bigram500', 'Top_comment_bigram501', 'Top_comment_bigram502', 'Top_comment_bigram503', 'Top_comment_bigram504', 'Top_comment_bigram505', 'Top_comment_bigram506', 'Top_comment_bigram507', 'Top_comment_bigram508', 'Top_comment_bigram509', 'Top_comment_bigram510', 'Top_comment_bigram511', 'Top_comment_bigram512', 'Top_comment_bigram513', 'Top_comment_bigram514', 'Top_comment_bigram515', 'Top_comment_bigram516', 'Top_comment_bigram517', 'Top_comment_bigram518', 'Top_comment_bigram519', 'Top_comment_bigram520', 'Top_comment_bigram521', 'Top_comment_bigram522', 'Top_comment_bigram523', 'Top_comment_bigram524', 'Top_comment_bigram525', 'Top_comment_bigram526', 'Top_comment_bigram527', 'Top_comment_bigram528', 'Top_comment_bigram529', 'Top_comment_bigram530', 'Top_comment_bigram531', 'Top_comment_bigram532', 'Top_comment_bigram533', 'Top_comment_bigram534', 'Top_comment_bigram535', 'Top_comment_bigram536', 'Top_comment_bigram537', 'Top_comment_bigram538', 'Top_comment_bigram539', 'Top_comment_bigram540', 'Top_comment_bigram541', 'Top_comment_bigram542', 'Top_comment_bigram543', 'Top_comment_bigram544', 'Top_comment_bigram545', 'Top_comment_bigram546', 'Top_comment_bigram547', 'Top_comment_bigram548', 'Top_comment_bigram549', 'Top_comment_bigram550', 'Top_comment_bigram551', 'Top_comment_bigram552', 'Top_comment_bigram553', 'Top_comment_bigram554', 'Top_comment_bigram555', 'Top_comment_bigram556', 'Top_comment_bigram557', 'Top_comment_bigram558', 'Top_comment_bigram559', 'Top_comment_bigram560', 'Top_comment_bigram561', 'Top_comment_bigram562', 'Top_comment_bigram563', 'Top_comment_bigram564', 'Top_comment_bigram565', 'Top_comment_bigram566', 'Top_comment_bigram567', 'Top_comment_bigram568', 'Top_comment_bigram569', 'Top_comment_bigram570', 'Top_comment_bigram571', 'Top_comment_bigram572', 'Top_comment_bigram573', 'Top_comment_bigram574', 'Top_comment_bigram575', 'Top_comment_bigram576', 'Top_comment_bigram577', 'Top_comment_bigram578', 'Top_comment_bigram579', 'Top_comment_bigram580', 'Top_comment_bigram581', 'Top_comment_bigram582', 'Top_comment_bigram583', 'Top_comment_bigram584', 'Top_comment_bigram585', 'Top_comment_bigram586', 'Top_comment_bigram587', 'Top_comment_bigram588', 'Top_comment_bigram589', 'Top_comment_bigram590', 'Top_comment_bigram591', 'Top_comment_bigram592', 'Top_comment_bigram593', 'Top_comment_bigram594', 'Top_comment_bigram595', 'Top_comment_bigram596', 'Top_comment_bigram597', 'Top_comment_bigram598', 'Top_comment_bigram599', 'Top_comment_bigram600', 'Top_comment_bigram601', 'Top_comment_bigram602', 'Top_comment_bigram603', 'Top_comment_bigram604', 'Top_comment_bigram605', 'Top_comment_bigram606', 'Top_comment_bigram607', 'Top_comment_bigram608', 'Top_comment_bigram609', 'Top_comment_bigram610', 'Top_comment_bigram611', 'Top_comment_bigram612', 'Top_comment_bigram613', 'Top_comment_bigram614', 'Top_comment_bigram615', 'Top_comment_bigram616', 'Top_comment_bigram617', 'Top_comment_bigram618', 'Top_comment_bigram619', 'Top_comment_bigram620', 'Top_comment_bigram621', 'Top_comment_bigram622', 'Top_comment_bigram623', 'Top_comment_bigram624', 'Top_comment_bigram625', 'Top_comment_bigram626', 'Top_comment_bigram627', 'Top_comment_bigram628', 'Top_comment_bigram629', 'Top_comment_bigram630', 'Top_comment_bigram631', 'Top_comment_bigram632', 'Top_comment_bigram633', 'Top_comment_bigram634', 'Top_comment_bigram635', 'Top_comment_bigram636', 'Top_comment_bigram637', 'Top_comment_bigram638', 'Top_comment_bigram639', 'Top_comment_bigram640', 'Top_comment_bigram641', 'Top_comment_bigram642', 'Top_comment_bigram643', 'Top_comment_bigram644', 'Top_comment_bigram645', 'Top_comment_bigram646', 'Top_comment_bigram647', 'Top_comment_bigram648', 'Top_comment_bigram649', 'Top_comment_bigram650', 'Top_comment_bigram651', 'Top_comment_bigram652', 'Top_comment_bigram653', 'Top_comment_bigram654', 'Top_comment_bigram655', 'Top_comment_bigram656', 'Top_comment_bigram657', 'Top_comment_bigram658', 'Top_comment_bigram659', 'Top_comment_bigram660', 'Top_comment_bigram661', 'Top_comment_bigram662', 'Top_comment_bigram663', 'Top_comment_bigram664', 'Top_comment_bigram665', 'Top_comment_bigram666', 'Top_comment_bigram667', 'Top_comment_bigram668', 'Top_comment_bigram669', 'Top_comment_bigram670', 'Top_comment_bigram671', 'Top_comment_bigram672', 'Top_comment_bigram673', 'Top_comment_bigram674', 'Top_comment_bigram675', 'Top_comment_bigram676', 'Top_comment_bigram677', 'Top_comment_bigram678', 'Top_comment_bigram679', 'Top_comment_bigram680', 'Top_comment_bigram681', 'Top_comment_bigram682', 'Top_comment_bigram683', 'Top_comment_bigram684', 'Top_comment_bigram685', 'Top_comment_bigram686', 'Top_comment_bigram687', 'Top_comment_bigram688', 'Top_comment_bigram689', 'Top_comment_bigram690', 'Top_comment_bigram691', 'Top_comment_bigram692', 'Top_comment_bigram693', 'Top_comment_bigram694', 'Top_comment_bigram695', 'Top_comment_bigram696', 'Top_comment_bigram697', 'Top_comment_bigram698', 'Top_comment_bigram699', 'Top_comment_bigram700', 'Top_comment_bigram701', 'Top_comment_bigram702', 'Top_comment_bigram703', 'Top_comment_bigram704', 'Top_comment_bigram705', 'Top_comment_bigram706', 'Top_comment_bigram707', 'Top_comment_bigram708', 'Top_comment_bigram709', 'Top_comment_bigram710', 'Top_comment_bigram711', 'Top_comment_bigram712', 'Top_comment_bigram713', 'Top_comment_bigram714', 'Top_comment_bigram715', 'Top_comment_bigram716', 'Top_comment_bigram717', 'Top_comment_bigram718', 'Top_comment_bigram719', 'Top_comment_bigram720', 'Top_comment_bigram721', 'Top_comment_bigram722', 'Top_comment_bigram723', 'Top_comment_bigram724', 'Top_comment_bigram725', 'Top_comment_bigram726', 'Top_comment_bigram727', 'Top_comment_bigram728', 'Top_comment_bigram729', 'Top_comment_bigram730', 'Top_comment_bigram731', 'Top_comment_bigram732', 'Top_comment_bigram733', 'Top_comment_bigram734', 'Top_comment_bigram735', 'Top_comment_bigram736', 'Top_comment_bigram737', 'Top_comment_bigram738', 'Top_comment_bigram739', 'Top_comment_bigram740', 'Top_comment_bigram741', 'Top_comment_bigram742', 'Top_comment_bigram743', 'Top_comment_bigram744', 'Top_comment_bigram745', 'Top_comment_bigram746', 'Top_comment_bigram747', 'Top_comment_bigram748', 'Top_comment_bigram749', 'Top_comment_bigram750', 'Top_comment_bigram751', 'Top_comment_bigram752', 'Top_comment_bigram753', 'Top_comment_bigram754', 'Top_comment_bigram755', 'Top_comment_bigram756', 'Top_comment_bigram757', 'Top_comment_bigram758', 'Top_comment_bigram759', 'Top_comment_bigram760', 'Top_comment_bigram761', 'Top_comment_bigram762', 'Top_comment_bigram763', 'Top_comment_bigram764', 'Top_comment_bigram765', 'Top_comment_bigram766', 'Top_comment_bigram767', 'Top_comment_bigram768', 'Top_comment_bigram769', 'Top_comment_bigram770', 'Top_comment_bigram771', 'Top_comment_bigram772', 'Top_comment_bigram773', 'Top_comment_bigram774', 'Top_comment_bigram775', 'Top_comment_bigram776', 'Top_comment_bigram777', 'Top_comment_bigram778', 'Top_comment_bigram779', 'Top_comment_bigram780', 'Top_comment_bigram781', 'Top_comment_bigram782', 'Top_comment_bigram783', 'Top_comment_bigram784', 'Top_comment_bigram785', 'Top_comment_bigram786', 'Top_comment_bigram787', 'Top_comment_bigram788', 'Top_comment_bigram789', 'Top_comment_bigram790', 'Top_comment_bigram791', 'Top_comment_bigram792', 'Top_comment_bigram793', 'Top_comment_bigram794', 'Top_comment_bigram795', 'Top_comment_bigram796', 'Top_comment_bigram797', 'Top_comment_bigram798', 'Top_comment_bigram799', 'Top_comment_bigram800', 'Top_comment_bigram801', 'Top_comment_bigram802', 'Top_comment_bigram803', 'Top_comment_bigram804', 'Top_comment_bigram805', 'Top_comment_bigram806', 'Top_comment_bigram807', 'Top_comment_bigram808', 'Top_comment_bigram809', 'Top_comment_bigram810', 'Top_comment_bigram811', 'Top_comment_bigram812', 'Top_comment_bigram813', 'Top_comment_bigram814', 'Top_comment_bigram815', 'Top_comment_bigram816', 'Top_comment_bigram817', 'Top_comment_bigram818', 'Top_comment_bigram819', 'Top_comment_bigram820', 'Top_comment_bigram821', 'Top_comment_bigram822', 'Top_comment_bigram823', 'Top_comment_bigram824', 'Top_comment_bigram825', 'Top_comment_bigram826', 'Top_comment_bigram827', 'Top_comment_bigram828', 'Top_comment_bigram829', 'Top_comment_bigram830', 'Top_comment_bigram831', 'Top_comment_bigram832', 'Top_comment_bigram833', 'Top_comment_bigram834', 'Top_comment_bigram835', 'Top_comment_bigram836', 'Top_comment_bigram837', 'Top_comment_bigram838', 'Top_comment_bigram839', 'Top_comment_bigram840', 'Top_comment_bigram841', 'Top_comment_bigram842', 'Top_comment_bigram843', 'Top_comment_bigram844', 'Top_comment_bigram845', 'Top_comment_bigram846', 'Top_comment_bigram847', 'Top_comment_bigram848', 'Top_comment_bigram849', 'Top_comment_bigram850', 'Top_comment_bigram851', 'Top_comment_bigram852', 'Top_comment_bigram853', 'Top_comment_bigram854', 'Top_comment_bigram855', 'Top_comment_bigram856', 'Top_comment_bigram857', 'Top_comment_bigram858', 'Top_comment_bigram859', 'Top_comment_bigram860', 'Top_comment_bigram861', 'Top_comment_bigram862', 'Top_comment_bigram863', 'Top_comment_bigram864', 'Top_comment_bigram865', 'Top_comment_bigram866', 'Top_comment_bigram867', 'Top_comment_bigram868', 'Top_comment_bigram869', 'Top_comment_bigram870', 'Top_comment_bigram871', 'Top_comment_bigram872', 'Top_comment_bigram873', 'Top_comment_bigram874', 'Top_comment_bigram875', 'Top_comment_bigram876', 'Top_comment_bigram877', 'Top_comment_bigram878', 'Top_comment_bigram879', 'Top_comment_bigram880', 'Top_comment_bigram881', 'Top_comment_bigram882', 'Top_comment_bigram883', 'Top_comment_bigram884', 'Top_comment_bigram885', 'Top_comment_bigram886', 'Top_comment_bigram887', 'Top_comment_bigram888', 'Top_comment_bigram889', 'Top_comment_bigram890', 'Top_comment_bigram891', 'Top_comment_bigram892', 'Top_comment_bigram893', 'Top_comment_bigram894', 'Top_comment_bigram895', 'Top_comment_bigram896', 'Top_comment_bigram897', 'Top_comment_bigram898', 'Top_comment_bigram899', 'Top_comment_bigram900', 'Top_comment_bigram901', 'Top_comment_bigram902', 'Top_comment_bigram903', 'Top_comment_bigram904', 'Top_comment_bigram905', 'Top_comment_bigram906', 'Top_comment_bigram907', 'Top_comment_bigram908', 'Top_comment_bigram909', 'Top_comment_bigram910', 'Top_comment_bigram911', 'Top_comment_bigram912', 'Top_comment_bigram913', 'Top_comment_bigram914', 'Top_comment_bigram915', 'Top_comment_bigram916', 'Top_comment_bigram917', 'Top_comment_bigram918', 'Top_comment_bigram919', 'Top_comment_bigram920', 'Top_comment_bigram921', 'Top_comment_bigram922', 'Top_comment_bigram923', 'Top_comment_bigram924', 'Top_comment_bigram925', 'Top_comment_bigram926', 'Top_comment_bigram927', 'Top_comment_bigram928', 'Top_comment_bigram929', 'Top_comment_bigram930', 'Top_comment_bigram931', 'Top_comment_bigram932', 'Top_comment_bigram933', 'Top_comment_bigram934', 'Top_comment_bigram935', 'Top_comment_bigram936', 'Top_comment_bigram937', 'Top_comment_bigram938', 'Top_comment_bigram939', 'Top_comment_bigram940', 'Top_comment_bigram941', 'Top_comment_bigram942', 'Top_comment_bigram943', 'Top_comment_bigram944', 'Top_comment_bigram945', 'Top_comment_bigram946', 'Top_comment_bigram947', 'Top_comment_bigram948', 'Top_comment_bigram949', 'Top_comment_bigram950', 'Top_comment_bigram951', 'Top_comment_bigram952', 'Top_comment_bigram953', 'Top_comment_bigram954', 'Top_comment_bigram955', 'Top_comment_bigram956', 'Top_comment_bigram957', 'Top_comment_bigram958', 'Top_comment_bigram959', 'Top_comment_bigram960', 'Top_comment_bigram961', 'Top_comment_bigram962', 'Top_comment_bigram963', 'Top_comment_bigram964', 'Top_comment_bigram965', 'Top_comment_bigram966', 'Top_comment_bigram967', 'Top_comment_bigram968', 'Top_comment_bigram969', 'Top_comment_bigram970', 'Top_comment_bigram971', 'Top_comment_bigram972', 'Top_comment_bigram973', 'Top_comment_bigram974', 'Top_comment_bigram975', 'Top_comment_bigram976', 'Top_comment_bigram977', 'Top_comment_bigram978', 'Top_comment_bigram979', 'Top_comment_bigram980', 'Top_comment_bigram981', 'Top_comment_bigram982', 'Top_comment_bigram983', 'Top_comment_bigram984', 'Top_comment_bigram985', 'Top_comment_bigram986', 'Top_comment_bigram987', 'Top_comment_bigram988', 'Top_comment_bigram989', 'Top_comment_bigram990', 'Top_comment_bigram991', 'Top_comment_bigram992', 'Top_comment_bigram993', 'Top_comment_bigram994', 'Top_comment_bigram995', 'Top_comment_bigram996', 'Top_comment_bigram997', 'Top_comment_bigram998', 'Top_comment_bigram999'] # 2065 features in XGBOOST OUTCOMES = [ 'Replies_informative_count', 'Replies_links_count', 'Replies_max_depth', 'Replies_sum_score', 'Replies_total_number', 'Top_comment_article_accommodation', 'Top_comment_certain_accommodation', 'Top_comment_conj_accommodation', 'Top_comment_discrep_accommodation', 'Top_comment_excl_accommodation', 'Top_comment_incl_accommodation', 'Top_comment_ipron_accommodation', 'Top_comment_negate_accommodation', 'Top_comment_quant_accommodation', 'Top_comment_tentat_accommodation', 'Replies_advice_count', 'Replies_laughter_count', 'Replies_gratitude_count', 'Replies_informative_URL_count', 'Replies_i_language_count', 'Replies_compliments_count', 'Replies_untuned_toxicity_children_count', 'Top_comment_direct_children', 'Replies_distinct_pairs_of_sustained_conversation', 'Replies_max_turns_of_sustained_conversations', 'Replies_untuned_non_toxic_percentage' ] # 26 metrics ALBERT_EIGENMETRICS = [ 'PC0' ] EIGENMETRICS = [ 'PC0' ] ALBERT_SUBREDDIT_HEADER = 'Top_comment_subreddit' ALBERT_TOP_COMMENT_TEXT_HEADER = 'Top_comment_text' ALBERT_POST_TEXT_HEADER = 'Post_text' Roberta_TOP_COMMENT_TEXT_HEADER = 'Top_comment_text' Roberta_EIGENMETRICS = 'PC0' PRIMARY_KEY = 'Top_comment_id' GENERIC_TOKEN = '<GENERIC>' GENERIC_ID = 0 NUM_SUBREDDIT_EMBEDDINGS = 11993 SUBREDDIT_EMBEDDINGS_SIZE = 16 ANNOTATION_ALBERT_TLC_TEXT_HEADER = ALBERT_TOP_COMMENT_TEXT_HEADER ANNOTATION_ALBERT_POST_TEXT_HEADER = ALBERT_POST_TEXT_HEADER ANNOTATION_ALBERT_SUBREDDIT_HEADER = ALBERT_SUBREDDIT_HEADER ANNOTATION_ALBERT_META_FEATURES = ALBERT_META_FEATURES ANNOTATION_ALBERT_LABEL_HEADER = 'human_label' BASELINE_ANNOTATION_MODEL_TLC_TEXT_HEADER = 'Top_comment_text' BASELINE_ANNOTATION_MODEL_LABEL_HEADER = 'human_label' ANNOTATION_XGBOOST_META_FEATURES = XGBOOST_FEATURES ANNOTATION_XGBOOST_LABELS_HEADER = 'human_label'
features = ['Post_Top_comment_Jaccard_sim', 'Post_Top_comment_topic_cosine_similarity', 'Post_text', 'Post_topic0', 'Post_topic1', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Top_comment_advice_count', 'Top_comment_agreement_value', 'Top_comment_and_Post_time_difference', 'Top_comment_author', 'Top_comment_author_gender_value', 'Top_comment_compliments_count', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_fundraising_URL_count', 'Top_comment_gratitude_count', 'Top_comment_hour', 'Top_comment_i_language_count', 'Top_comment_informative_URL_count', 'Top_comment_informative_count', 'Top_comment_laughter_count', 'Top_comment_link_count', 'Top_comment_mispellings', 'Top_comment_polarity', 'Top_comment_politeness_value', 'Top_comment_readability', 'Top_comment_score', 'Top_comment_subjectivity', 'Top_comment_subreddit', 'Top_comment_support_value', 'Top_comment_text', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_word_count'] albert_meta_features = ['Post_Top_comment_Jaccard_sim', 'Post_Top_comment_topic_cosine_similarity', 'Post_topic0', 'Post_topic1', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Top_comment_advice_count', 'Top_comment_agreement_value', 'Top_comment_and_Post_time_difference', 'Top_comment_author_gender_value', 'Top_comment_compliments_count', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_fundraising_URL_count', 'Top_comment_gratitude_count', 'Top_comment_hour', 'Top_comment_i_language_count', 'Top_comment_informative_URL_count', 'Top_comment_informative_count', 'Top_comment_laughter_count', 'Top_comment_link_count', 'Top_comment_mispellings', 'Top_comment_polarity', 'Top_comment_politeness_value', 'Top_comment_readability', 'Top_comment_score', 'Top_comment_subjectivity', 'Top_comment_support_value', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_word_count'] xgboost_features = ['Top_comment_and_Post_time_difference', 'Top_comment_day', 'Top_comment_day_of_week', 'Top_comment_hour', 'Top_comment_link_count', 'Top_comment_score', 'Top_comment_mispellings', 'Top_comment_author_gender_value', 'Top_comment_agreement_value', 'Top_comment_support_value', 'Top_comment_politeness_value', 'Top_comment_informative_count', 'Top_comment_advice_count', 'Top_comment_laughter_count', 'Top_comment_gratitude_count', 'Top_comment_fundraising_URL_count', 'Top_comment_informative_URL_count', 'Top_comment_i_language_count', 'Top_comment_compliments_count', 'Top_comment_tuned_toxicity', 'Top_comment_untuned_toxicity', 'Top_comment_topic0', 'Top_comment_topic1', 'Top_comment_topic2', 'Top_comment_topic3', 'Top_comment_topic4', 'Top_comment_topic5', 'Top_comment_topic6', 'Top_comment_topic7', 'Top_comment_topic8', 'Top_comment_topic9', 'Top_comment_topic10', 'Top_comment_topic11', 'Top_comment_topic12', 'Top_comment_topic13', 'Top_comment_topic14', 'Top_comment_topic15', 'Top_comment_topic16', 'Top_comment_topic17', 'Top_comment_topic18', 'Post_topic0', 'Post_topic1', 'Post_topic2', 'Post_topic3', 'Post_topic4', 'Post_topic5', 'Post_topic6', 'Post_topic7', 'Post_topic8', 'Post_topic9', 'Post_topic10', 'Post_topic11', 'Post_topic12', 'Post_topic13', 'Post_topic14', 'Post_topic15', 'Post_topic16', 'Post_topic17', 'Post_topic18', 'Post_Top_comment_topic_cosine_similarity', 'Post_Top_comment_Jaccard_sim', 'Top_comment_polarity', 'Top_comment_subjectivity', 'Top_comment_word_count', 'Top_comment_readability', 'Top_comment_unigram0', 'Top_comment_unigram1', 'Top_comment_unigram2', 'Top_comment_unigram3', 'Top_comment_unigram4', 'Top_comment_unigram5', 'Top_comment_unigram6', 'Top_comment_unigram7', 'Top_comment_unigram8', 'Top_comment_unigram9', 'Top_comment_unigram10', 'Top_comment_unigram11', 'Top_comment_unigram12', 'Top_comment_unigram13', 'Top_comment_unigram14', 'Top_comment_unigram15', 'Top_comment_unigram16', 'Top_comment_unigram17', 'Top_comment_unigram18', 'Top_comment_unigram19', 'Top_comment_unigram20', 'Top_comment_unigram21', 'Top_comment_unigram22', 'Top_comment_unigram23', 'Top_comment_unigram24', 'Top_comment_unigram25', 'Top_comment_unigram26', 'Top_comment_unigram27', 'Top_comment_unigram28', 'Top_comment_unigram29', 'Top_comment_unigram30', 'Top_comment_unigram31', 'Top_comment_unigram32', 'Top_comment_unigram33', 'Top_comment_unigram34', 'Top_comment_unigram35', 'Top_comment_unigram36', 'Top_comment_unigram37', 'Top_comment_unigram38', 'Top_comment_unigram39', 'Top_comment_unigram40', 'Top_comment_unigram41', 'Top_comment_unigram42', 'Top_comment_unigram43', 'Top_comment_unigram44', 'Top_comment_unigram45', 'Top_comment_unigram46', 'Top_comment_unigram47', 'Top_comment_unigram48', 'Top_comment_unigram49', 'Top_comment_unigram50', 'Top_comment_unigram51', 'Top_comment_unigram52', 'Top_comment_unigram53', 'Top_comment_unigram54', 'Top_comment_unigram55', 'Top_comment_unigram56', 'Top_comment_unigram57', 'Top_comment_unigram58', 'Top_comment_unigram59', 'Top_comment_unigram60', 'Top_comment_unigram61', 'Top_comment_unigram62', 'Top_comment_unigram63', 'Top_comment_unigram64', 'Top_comment_unigram65', 'Top_comment_unigram66', 'Top_comment_unigram67', 'Top_comment_unigram68', 'Top_comment_unigram69', 'Top_comment_unigram70', 'Top_comment_unigram71', 'Top_comment_unigram72', 'Top_comment_unigram73', 'Top_comment_unigram74', 'Top_comment_unigram75', 'Top_comment_unigram76', 'Top_comment_unigram77', 'Top_comment_unigram78', 'Top_comment_unigram79', 'Top_comment_unigram80', 'Top_comment_unigram81', 'Top_comment_unigram82', 'Top_comment_unigram83', 'Top_comment_unigram84', 'Top_comment_unigram85', 'Top_comment_unigram86', 'Top_comment_unigram87', 'Top_comment_unigram88', 'Top_comment_unigram89', 'Top_comment_unigram90', 'Top_comment_unigram91', 'Top_comment_unigram92', 'Top_comment_unigram93', 'Top_comment_unigram94', 'Top_comment_unigram95', 'Top_comment_unigram96', 'Top_comment_unigram97', 'Top_comment_unigram98', 'Top_comment_unigram99', 'Top_comment_unigram100', 'Top_comment_unigram101', 'Top_comment_unigram102', 'Top_comment_unigram103', 'Top_comment_unigram104', 'Top_comment_unigram105', 'Top_comment_unigram106', 'Top_comment_unigram107', 'Top_comment_unigram108', 'Top_comment_unigram109', 'Top_comment_unigram110', 'Top_comment_unigram111', 'Top_comment_unigram112', 'Top_comment_unigram113', 'Top_comment_unigram114', 'Top_comment_unigram115', 'Top_comment_unigram116', 'Top_comment_unigram117', 'Top_comment_unigram118', 'Top_comment_unigram119', 'Top_comment_unigram120', 'Top_comment_unigram121', 'Top_comment_unigram122', 'Top_comment_unigram123', 'Top_comment_unigram124', 'Top_comment_unigram125', 'Top_comment_unigram126', 'Top_comment_unigram127', 'Top_comment_unigram128', 'Top_comment_unigram129', 'Top_comment_unigram130', 'Top_comment_unigram131', 'Top_comment_unigram132', 'Top_comment_unigram133', 'Top_comment_unigram134', 'Top_comment_unigram135', 'Top_comment_unigram136', 'Top_comment_unigram137', 'Top_comment_unigram138', 'Top_comment_unigram139', 'Top_comment_unigram140', 'Top_comment_unigram141', 'Top_comment_unigram142', 'Top_comment_unigram143', 'Top_comment_unigram144', 'Top_comment_unigram145', 'Top_comment_unigram146', 'Top_comment_unigram147', 'Top_comment_unigram148', 'Top_comment_unigram149', 'Top_comment_unigram150', 'Top_comment_unigram151', 'Top_comment_unigram152', 'Top_comment_unigram153', 'Top_comment_unigram154', 'Top_comment_unigram155', 'Top_comment_unigram156', 'Top_comment_unigram157', 'Top_comment_unigram158', 'Top_comment_unigram159', 'Top_comment_unigram160', 'Top_comment_unigram161', 'Top_comment_unigram162', 'Top_comment_unigram163', 'Top_comment_unigram164', 'Top_comment_unigram165', 'Top_comment_unigram166', 'Top_comment_unigram167', 'Top_comment_unigram168', 'Top_comment_unigram169', 'Top_comment_unigram170', 'Top_comment_unigram171', 'Top_comment_unigram172', 'Top_comment_unigram173', 'Top_comment_unigram174', 'Top_comment_unigram175', 'Top_comment_unigram176', 'Top_comment_unigram177', 'Top_comment_unigram178', 'Top_comment_unigram179', 'Top_comment_unigram180', 'Top_comment_unigram181', 'Top_comment_unigram182', 'Top_comment_unigram183', 'Top_comment_unigram184', 'Top_comment_unigram185', 'Top_comment_unigram186', 'Top_comment_unigram187', 'Top_comment_unigram188', 'Top_comment_unigram189', 'Top_comment_unigram190', 'Top_comment_unigram191', 'Top_comment_unigram192', 'Top_comment_unigram193', 'Top_comment_unigram194', 'Top_comment_unigram195', 'Top_comment_unigram196', 'Top_comment_unigram197', 'Top_comment_unigram198', 'Top_comment_unigram199', 'Top_comment_unigram200', 'Top_comment_unigram201', 'Top_comment_unigram202', 'Top_comment_unigram203', 'Top_comment_unigram204', 'Top_comment_unigram205', 'Top_comment_unigram206', 'Top_comment_unigram207', 'Top_comment_unigram208', 'Top_comment_unigram209', 'Top_comment_unigram210', 'Top_comment_unigram211', 'Top_comment_unigram212', 'Top_comment_unigram213', 'Top_comment_unigram214', 'Top_comment_unigram215', 'Top_comment_unigram216', 'Top_comment_unigram217', 'Top_comment_unigram218', 'Top_comment_unigram219', 'Top_comment_unigram220', 'Top_comment_unigram221', 'Top_comment_unigram222', 'Top_comment_unigram223', 'Top_comment_unigram224', 'Top_comment_unigram225', 'Top_comment_unigram226', 'Top_comment_unigram227', 'Top_comment_unigram228', 'Top_comment_unigram229', 'Top_comment_unigram230', 'Top_comment_unigram231', 'Top_comment_unigram232', 'Top_comment_unigram233', 'Top_comment_unigram234', 'Top_comment_unigram235', 'Top_comment_unigram236', 'Top_comment_unigram237', 'Top_comment_unigram238', 'Top_comment_unigram239', 'Top_comment_unigram240', 'Top_comment_unigram241', 'Top_comment_unigram242', 'Top_comment_unigram243', 'Top_comment_unigram244', 'Top_comment_unigram245', 'Top_comment_unigram246', 'Top_comment_unigram247', 'Top_comment_unigram248', 'Top_comment_unigram249', 'Top_comment_unigram250', 'Top_comment_unigram251', 'Top_comment_unigram252', 'Top_comment_unigram253', 'Top_comment_unigram254', 'Top_comment_unigram255', 'Top_comment_unigram256', 'Top_comment_unigram257', 'Top_comment_unigram258', 'Top_comment_unigram259', 'Top_comment_unigram260', 'Top_comment_unigram261', 'Top_comment_unigram262', 'Top_comment_unigram263', 'Top_comment_unigram264', 'Top_comment_unigram265', 'Top_comment_unigram266', 'Top_comment_unigram267', 'Top_comment_unigram268', 'Top_comment_unigram269', 'Top_comment_unigram270', 'Top_comment_unigram271', 'Top_comment_unigram272', 'Top_comment_unigram273', 'Top_comment_unigram274', 'Top_comment_unigram275', 'Top_comment_unigram276', 'Top_comment_unigram277', 'Top_comment_unigram278', 'Top_comment_unigram279', 'Top_comment_unigram280', 'Top_comment_unigram281', 'Top_comment_unigram282', 'Top_comment_unigram283', 'Top_comment_unigram284', 'Top_comment_unigram285', 'Top_comment_unigram286', 'Top_comment_unigram287', 'Top_comment_unigram288', 'Top_comment_unigram289', 'Top_comment_unigram290', 'Top_comment_unigram291', 'Top_comment_unigram292', 'Top_comment_unigram293', 'Top_comment_unigram294', 'Top_comment_unigram295', 'Top_comment_unigram296', 'Top_comment_unigram297', 'Top_comment_unigram298', 'Top_comment_unigram299', 'Top_comment_unigram300', 'Top_comment_unigram301', 'Top_comment_unigram302', 'Top_comment_unigram303', 'Top_comment_unigram304', 'Top_comment_unigram305', 'Top_comment_unigram306', 'Top_comment_unigram307', 'Top_comment_unigram308', 'Top_comment_unigram309', 'Top_comment_unigram310', 'Top_comment_unigram311', 'Top_comment_unigram312', 'Top_comment_unigram313', 'Top_comment_unigram314', 'Top_comment_unigram315', 'Top_comment_unigram316', 'Top_comment_unigram317', 'Top_comment_unigram318', 'Top_comment_unigram319', 'Top_comment_unigram320', 'Top_comment_unigram321', 'Top_comment_unigram322', 'Top_comment_unigram323', 'Top_comment_unigram324', 'Top_comment_unigram325', 'Top_comment_unigram326', 'Top_comment_unigram327', 'Top_comment_unigram328', 'Top_comment_unigram329', 'Top_comment_unigram330', 'Top_comment_unigram331', 'Top_comment_unigram332', 'Top_comment_unigram333', 'Top_comment_unigram334', 'Top_comment_unigram335', 'Top_comment_unigram336', 'Top_comment_unigram337', 'Top_comment_unigram338', 'Top_comment_unigram339', 'Top_comment_unigram340', 'Top_comment_unigram341', 'Top_comment_unigram342', 'Top_comment_unigram343', 'Top_comment_unigram344', 'Top_comment_unigram345', 'Top_comment_unigram346', 'Top_comment_unigram347', 'Top_comment_unigram348', 'Top_comment_unigram349', 'Top_comment_unigram350', 'Top_comment_unigram351', 'Top_comment_unigram352', 'Top_comment_unigram353', 'Top_comment_unigram354', 'Top_comment_unigram355', 'Top_comment_unigram356', 'Top_comment_unigram357', 'Top_comment_unigram358', 'Top_comment_unigram359', 'Top_comment_unigram360', 'Top_comment_unigram361', 'Top_comment_unigram362', 'Top_comment_unigram363', 'Top_comment_unigram364', 'Top_comment_unigram365', 'Top_comment_unigram366', 'Top_comment_unigram367', 'Top_comment_unigram368', 'Top_comment_unigram369', 'Top_comment_unigram370', 'Top_comment_unigram371', 'Top_comment_unigram372', 'Top_comment_unigram373', 'Top_comment_unigram374', 'Top_comment_unigram375', 'Top_comment_unigram376', 'Top_comment_unigram377', 'Top_comment_unigram378', 'Top_comment_unigram379', 'Top_comment_unigram380', 'Top_comment_unigram381', 'Top_comment_unigram382', 'Top_comment_unigram383', 'Top_comment_unigram384', 'Top_comment_unigram385', 'Top_comment_unigram386', 'Top_comment_unigram387', 'Top_comment_unigram388', 'Top_comment_unigram389', 'Top_comment_unigram390', 'Top_comment_unigram391', 'Top_comment_unigram392', 'Top_comment_unigram393', 'Top_comment_unigram394', 'Top_comment_unigram395', 'Top_comment_unigram396', 'Top_comment_unigram397', 'Top_comment_unigram398', 'Top_comment_unigram399', 'Top_comment_unigram400', 'Top_comment_unigram401', 'Top_comment_unigram402', 'Top_comment_unigram403', 'Top_comment_unigram404', 'Top_comment_unigram405', 'Top_comment_unigram406', 'Top_comment_unigram407', 'Top_comment_unigram408', 'Top_comment_unigram409', 'Top_comment_unigram410', 'Top_comment_unigram411', 'Top_comment_unigram412', 'Top_comment_unigram413', 'Top_comment_unigram414', 'Top_comment_unigram415', 'Top_comment_unigram416', 'Top_comment_unigram417', 'Top_comment_unigram418', 'Top_comment_unigram419', 'Top_comment_unigram420', 'Top_comment_unigram421', 'Top_comment_unigram422', 'Top_comment_unigram423', 'Top_comment_unigram424', 'Top_comment_unigram425', 'Top_comment_unigram426', 'Top_comment_unigram427', 'Top_comment_unigram428', 'Top_comment_unigram429', 'Top_comment_unigram430', 'Top_comment_unigram431', 'Top_comment_unigram432', 'Top_comment_unigram433', 'Top_comment_unigram434', 'Top_comment_unigram435', 'Top_comment_unigram436', 'Top_comment_unigram437', 'Top_comment_unigram438', 'Top_comment_unigram439', 'Top_comment_unigram440', 'Top_comment_unigram441', 'Top_comment_unigram442', 'Top_comment_unigram443', 'Top_comment_unigram444', 'Top_comment_unigram445', 'Top_comment_unigram446', 'Top_comment_unigram447', 'Top_comment_unigram448', 'Top_comment_unigram449', 'Top_comment_unigram450', 'Top_comment_unigram451', 'Top_comment_unigram452', 'Top_comment_unigram453', 'Top_comment_unigram454', 'Top_comment_unigram455', 'Top_comment_unigram456', 'Top_comment_unigram457', 'Top_comment_unigram458', 'Top_comment_unigram459', 'Top_comment_unigram460', 'Top_comment_unigram461', 'Top_comment_unigram462', 'Top_comment_unigram463', 'Top_comment_unigram464', 'Top_comment_unigram465', 'Top_comment_unigram466', 'Top_comment_unigram467', 'Top_comment_unigram468', 'Top_comment_unigram469', 'Top_comment_unigram470', 'Top_comment_unigram471', 'Top_comment_unigram472', 'Top_comment_unigram473', 'Top_comment_unigram474', 'Top_comment_unigram475', 'Top_comment_unigram476', 'Top_comment_unigram477', 'Top_comment_unigram478', 'Top_comment_unigram479', 'Top_comment_unigram480', 'Top_comment_unigram481', 'Top_comment_unigram482', 'Top_comment_unigram483', 'Top_comment_unigram484', 'Top_comment_unigram485', 'Top_comment_unigram486', 'Top_comment_unigram487', 'Top_comment_unigram488', 'Top_comment_unigram489', 'Top_comment_unigram490', 'Top_comment_unigram491', 'Top_comment_unigram492', 'Top_comment_unigram493', 'Top_comment_unigram494', 'Top_comment_unigram495', 'Top_comment_unigram496', 'Top_comment_unigram497', 'Top_comment_unigram498', 'Top_comment_unigram499', 'Top_comment_unigram500', 'Top_comment_unigram501', 'Top_comment_unigram502', 'Top_comment_unigram503', 'Top_comment_unigram504', 'Top_comment_unigram505', 'Top_comment_unigram506', 'Top_comment_unigram507', 'Top_comment_unigram508', 'Top_comment_unigram509', 'Top_comment_unigram510', 'Top_comment_unigram511', 'Top_comment_unigram512', 'Top_comment_unigram513', 'Top_comment_unigram514', 'Top_comment_unigram515', 'Top_comment_unigram516', 'Top_comment_unigram517', 'Top_comment_unigram518', 'Top_comment_unigram519', 'Top_comment_unigram520', 'Top_comment_unigram521', 'Top_comment_unigram522', 'Top_comment_unigram523', 'Top_comment_unigram524', 'Top_comment_unigram525', 'Top_comment_unigram526', 'Top_comment_unigram527', 'Top_comment_unigram528', 'Top_comment_unigram529', 'Top_comment_unigram530', 'Top_comment_unigram531', 'Top_comment_unigram532', 'Top_comment_unigram533', 'Top_comment_unigram534', 'Top_comment_unigram535', 'Top_comment_unigram536', 'Top_comment_unigram537', 'Top_comment_unigram538', 'Top_comment_unigram539', 'Top_comment_unigram540', 'Top_comment_unigram541', 'Top_comment_unigram542', 'Top_comment_unigram543', 'Top_comment_unigram544', 'Top_comment_unigram545', 'Top_comment_unigram546', 'Top_comment_unigram547', 'Top_comment_unigram548', 'Top_comment_unigram549', 'Top_comment_unigram550', 'Top_comment_unigram551', 'Top_comment_unigram552', 'Top_comment_unigram553', 'Top_comment_unigram554', 'Top_comment_unigram555', 'Top_comment_unigram556', 'Top_comment_unigram557', 'Top_comment_unigram558', 'Top_comment_unigram559', 'Top_comment_unigram560', 'Top_comment_unigram561', 'Top_comment_unigram562', 'Top_comment_unigram563', 'Top_comment_unigram564', 'Top_comment_unigram565', 'Top_comment_unigram566', 'Top_comment_unigram567', 'Top_comment_unigram568', 'Top_comment_unigram569', 'Top_comment_unigram570', 'Top_comment_unigram571', 'Top_comment_unigram572', 'Top_comment_unigram573', 'Top_comment_unigram574', 'Top_comment_unigram575', 'Top_comment_unigram576', 'Top_comment_unigram577', 'Top_comment_unigram578', 'Top_comment_unigram579', 'Top_comment_unigram580', 'Top_comment_unigram581', 'Top_comment_unigram582', 'Top_comment_unigram583', 'Top_comment_unigram584', 'Top_comment_unigram585', 'Top_comment_unigram586', 'Top_comment_unigram587', 'Top_comment_unigram588', 'Top_comment_unigram589', 'Top_comment_unigram590', 'Top_comment_unigram591', 'Top_comment_unigram592', 'Top_comment_unigram593', 'Top_comment_unigram594', 'Top_comment_unigram595', 'Top_comment_unigram596', 'Top_comment_unigram597', 'Top_comment_unigram598', 'Top_comment_unigram599', 'Top_comment_unigram600', 'Top_comment_unigram601', 'Top_comment_unigram602', 'Top_comment_unigram603', 'Top_comment_unigram604', 'Top_comment_unigram605', 'Top_comment_unigram606', 'Top_comment_unigram607', 'Top_comment_unigram608', 'Top_comment_unigram609', 'Top_comment_unigram610', 'Top_comment_unigram611', 'Top_comment_unigram612', 'Top_comment_unigram613', 'Top_comment_unigram614', 'Top_comment_unigram615', 'Top_comment_unigram616', 'Top_comment_unigram617', 'Top_comment_unigram618', 'Top_comment_unigram619', 'Top_comment_unigram620', 'Top_comment_unigram621', 'Top_comment_unigram622', 'Top_comment_unigram623', 'Top_comment_unigram624', 'Top_comment_unigram625', 'Top_comment_unigram626', 'Top_comment_unigram627', 'Top_comment_unigram628', 'Top_comment_unigram629', 'Top_comment_unigram630', 'Top_comment_unigram631', 'Top_comment_unigram632', 'Top_comment_unigram633', 'Top_comment_unigram634', 'Top_comment_unigram635', 'Top_comment_unigram636', 'Top_comment_unigram637', 'Top_comment_unigram638', 'Top_comment_unigram639', 'Top_comment_unigram640', 'Top_comment_unigram641', 'Top_comment_unigram642', 'Top_comment_unigram643', 'Top_comment_unigram644', 'Top_comment_unigram645', 'Top_comment_unigram646', 'Top_comment_unigram647', 'Top_comment_unigram648', 'Top_comment_unigram649', 'Top_comment_unigram650', 'Top_comment_unigram651', 'Top_comment_unigram652', 'Top_comment_unigram653', 'Top_comment_unigram654', 'Top_comment_unigram655', 'Top_comment_unigram656', 'Top_comment_unigram657', 'Top_comment_unigram658', 'Top_comment_unigram659', 'Top_comment_unigram660', 'Top_comment_unigram661', 'Top_comment_unigram662', 'Top_comment_unigram663', 'Top_comment_unigram664', 'Top_comment_unigram665', 'Top_comment_unigram666', 'Top_comment_unigram667', 'Top_comment_unigram668', 'Top_comment_unigram669', 'Top_comment_unigram670', 'Top_comment_unigram671', 'Top_comment_unigram672', 'Top_comment_unigram673', 'Top_comment_unigram674', 'Top_comment_unigram675', 'Top_comment_unigram676', 'Top_comment_unigram677', 'Top_comment_unigram678', 'Top_comment_unigram679', 'Top_comment_unigram680', 'Top_comment_unigram681', 'Top_comment_unigram682', 'Top_comment_unigram683', 'Top_comment_unigram684', 'Top_comment_unigram685', 'Top_comment_unigram686', 'Top_comment_unigram687', 'Top_comment_unigram688', 'Top_comment_unigram689', 'Top_comment_unigram690', 'Top_comment_unigram691', 'Top_comment_unigram692', 'Top_comment_unigram693', 'Top_comment_unigram694', 'Top_comment_unigram695', 'Top_comment_unigram696', 'Top_comment_unigram697', 'Top_comment_unigram698', 'Top_comment_unigram699', 'Top_comment_unigram700', 'Top_comment_unigram701', 'Top_comment_unigram702', 'Top_comment_unigram703', 'Top_comment_unigram704', 'Top_comment_unigram705', 'Top_comment_unigram706', 'Top_comment_unigram707', 'Top_comment_unigram708', 'Top_comment_unigram709', 'Top_comment_unigram710', 'Top_comment_unigram711', 'Top_comment_unigram712', 'Top_comment_unigram713', 'Top_comment_unigram714', 'Top_comment_unigram715', 'Top_comment_unigram716', 'Top_comment_unigram717', 'Top_comment_unigram718', 'Top_comment_unigram719', 'Top_comment_unigram720', 'Top_comment_unigram721', 'Top_comment_unigram722', 'Top_comment_unigram723', 'Top_comment_unigram724', 'Top_comment_unigram725', 'Top_comment_unigram726', 'Top_comment_unigram727', 'Top_comment_unigram728', 'Top_comment_unigram729', 'Top_comment_unigram730', 'Top_comment_unigram731', 'Top_comment_unigram732', 'Top_comment_unigram733', 'Top_comment_unigram734', 'Top_comment_unigram735', 'Top_comment_unigram736', 'Top_comment_unigram737', 'Top_comment_unigram738', 'Top_comment_unigram739', 'Top_comment_unigram740', 'Top_comment_unigram741', 'Top_comment_unigram742', 'Top_comment_unigram743', 'Top_comment_unigram744', 'Top_comment_unigram745', 'Top_comment_unigram746', 'Top_comment_unigram747', 'Top_comment_unigram748', 'Top_comment_unigram749', 'Top_comment_unigram750', 'Top_comment_unigram751', 'Top_comment_unigram752', 'Top_comment_unigram753', 'Top_comment_unigram754', 'Top_comment_unigram755', 'Top_comment_unigram756', 'Top_comment_unigram757', 'Top_comment_unigram758', 'Top_comment_unigram759', 'Top_comment_unigram760', 'Top_comment_unigram761', 'Top_comment_unigram762', 'Top_comment_unigram763', 'Top_comment_unigram764', 'Top_comment_unigram765', 'Top_comment_unigram766', 'Top_comment_unigram767', 'Top_comment_unigram768', 'Top_comment_unigram769', 'Top_comment_unigram770', 'Top_comment_unigram771', 'Top_comment_unigram772', 'Top_comment_unigram773', 'Top_comment_unigram774', 'Top_comment_unigram775', 'Top_comment_unigram776', 'Top_comment_unigram777', 'Top_comment_unigram778', 'Top_comment_unigram779', 'Top_comment_unigram780', 'Top_comment_unigram781', 'Top_comment_unigram782', 'Top_comment_unigram783', 'Top_comment_unigram784', 'Top_comment_unigram785', 'Top_comment_unigram786', 'Top_comment_unigram787', 'Top_comment_unigram788', 'Top_comment_unigram789', 'Top_comment_unigram790', 'Top_comment_unigram791', 'Top_comment_unigram792', 'Top_comment_unigram793', 'Top_comment_unigram794', 'Top_comment_unigram795', 'Top_comment_unigram796', 'Top_comment_unigram797', 'Top_comment_unigram798', 'Top_comment_unigram799', 'Top_comment_unigram800', 'Top_comment_unigram801', 'Top_comment_unigram802', 'Top_comment_unigram803', 'Top_comment_unigram804', 'Top_comment_unigram805', 'Top_comment_unigram806', 'Top_comment_unigram807', 'Top_comment_unigram808', 'Top_comment_unigram809', 'Top_comment_unigram810', 'Top_comment_unigram811', 'Top_comment_unigram812', 'Top_comment_unigram813', 'Top_comment_unigram814', 'Top_comment_unigram815', 'Top_comment_unigram816', 'Top_comment_unigram817', 'Top_comment_unigram818', 'Top_comment_unigram819', 'Top_comment_unigram820', 'Top_comment_unigram821', 'Top_comment_unigram822', 'Top_comment_unigram823', 'Top_comment_unigram824', 'Top_comment_unigram825', 'Top_comment_unigram826', 'Top_comment_unigram827', 'Top_comment_unigram828', 'Top_comment_unigram829', 'Top_comment_unigram830', 'Top_comment_unigram831', 'Top_comment_unigram832', 'Top_comment_unigram833', 'Top_comment_unigram834', 'Top_comment_unigram835', 'Top_comment_unigram836', 'Top_comment_unigram837', 'Top_comment_unigram838', 'Top_comment_unigram839', 'Top_comment_unigram840', 'Top_comment_unigram841', 'Top_comment_unigram842', 'Top_comment_unigram843', 'Top_comment_unigram844', 'Top_comment_unigram845', 'Top_comment_unigram846', 'Top_comment_unigram847', 'Top_comment_unigram848', 'Top_comment_unigram849', 'Top_comment_unigram850', 'Top_comment_unigram851', 'Top_comment_unigram852', 'Top_comment_unigram853', 'Top_comment_unigram854', 'Top_comment_unigram855', 'Top_comment_unigram856', 'Top_comment_unigram857', 'Top_comment_unigram858', 'Top_comment_unigram859', 'Top_comment_unigram860', 'Top_comment_unigram861', 'Top_comment_unigram862', 'Top_comment_unigram863', 'Top_comment_unigram864', 'Top_comment_unigram865', 'Top_comment_unigram866', 'Top_comment_unigram867', 'Top_comment_unigram868', 'Top_comment_unigram869', 'Top_comment_unigram870', 'Top_comment_unigram871', 'Top_comment_unigram872', 'Top_comment_unigram873', 'Top_comment_unigram874', 'Top_comment_unigram875', 'Top_comment_unigram876', 'Top_comment_unigram877', 'Top_comment_unigram878', 'Top_comment_unigram879', 'Top_comment_unigram880', 'Top_comment_unigram881', 'Top_comment_unigram882', 'Top_comment_unigram883', 'Top_comment_unigram884', 'Top_comment_unigram885', 'Top_comment_unigram886', 'Top_comment_unigram887', 'Top_comment_unigram888', 'Top_comment_unigram889', 'Top_comment_unigram890', 'Top_comment_unigram891', 'Top_comment_unigram892', 'Top_comment_unigram893', 'Top_comment_unigram894', 'Top_comment_unigram895', 'Top_comment_unigram896', 'Top_comment_unigram897', 'Top_comment_unigram898', 'Top_comment_unigram899', 'Top_comment_unigram900', 'Top_comment_unigram901', 'Top_comment_unigram902', 'Top_comment_unigram903', 'Top_comment_unigram904', 'Top_comment_unigram905', 'Top_comment_unigram906', 'Top_comment_unigram907', 'Top_comment_unigram908', 'Top_comment_unigram909', 'Top_comment_unigram910', 'Top_comment_unigram911', 'Top_comment_unigram912', 'Top_comment_unigram913', 'Top_comment_unigram914', 'Top_comment_unigram915', 'Top_comment_unigram916', 'Top_comment_unigram917', 'Top_comment_unigram918', 'Top_comment_unigram919', 'Top_comment_unigram920', 'Top_comment_unigram921', 'Top_comment_unigram922', 'Top_comment_unigram923', 'Top_comment_unigram924', 'Top_comment_unigram925', 'Top_comment_unigram926', 'Top_comment_unigram927', 'Top_comment_unigram928', 'Top_comment_unigram929', 'Top_comment_unigram930', 'Top_comment_unigram931', 'Top_comment_unigram932', 'Top_comment_unigram933', 'Top_comment_unigram934', 'Top_comment_unigram935', 'Top_comment_unigram936', 'Top_comment_unigram937', 'Top_comment_unigram938', 'Top_comment_unigram939', 'Top_comment_unigram940', 'Top_comment_unigram941', 'Top_comment_unigram942', 'Top_comment_unigram943', 'Top_comment_unigram944', 'Top_comment_unigram945', 'Top_comment_unigram946', 'Top_comment_unigram947', 'Top_comment_unigram948', 'Top_comment_unigram949', 'Top_comment_unigram950', 'Top_comment_unigram951', 'Top_comment_unigram952', 'Top_comment_unigram953', 'Top_comment_unigram954', 'Top_comment_unigram955', 'Top_comment_unigram956', 'Top_comment_unigram957', 'Top_comment_unigram958', 'Top_comment_unigram959', 'Top_comment_unigram960', 'Top_comment_unigram961', 'Top_comment_unigram962', 'Top_comment_unigram963', 'Top_comment_unigram964', 'Top_comment_unigram965', 'Top_comment_unigram966', 'Top_comment_unigram967', 'Top_comment_unigram968', 'Top_comment_unigram969', 'Top_comment_unigram970', 'Top_comment_unigram971', 'Top_comment_unigram972', 'Top_comment_unigram973', 'Top_comment_unigram974', 'Top_comment_unigram975', 'Top_comment_unigram976', 'Top_comment_unigram977', 'Top_comment_unigram978', 'Top_comment_unigram979', 'Top_comment_unigram980', 'Top_comment_unigram981', 'Top_comment_unigram982', 'Top_comment_unigram983', 'Top_comment_unigram984', 'Top_comment_unigram985', 'Top_comment_unigram986', 'Top_comment_unigram987', 'Top_comment_unigram988', 'Top_comment_unigram989', 'Top_comment_unigram990', 'Top_comment_unigram991', 'Top_comment_unigram992', 'Top_comment_unigram993', 'Top_comment_unigram994', 'Top_comment_unigram995', 'Top_comment_unigram996', 'Top_comment_unigram997', 'Top_comment_unigram998', 'Top_comment_unigram999', 'Top_comment_bigram0', 'Top_comment_bigram1', 'Top_comment_bigram2', 'Top_comment_bigram3', 'Top_comment_bigram4', 'Top_comment_bigram5', 'Top_comment_bigram6', 'Top_comment_bigram7', 'Top_comment_bigram8', 'Top_comment_bigram9', 'Top_comment_bigram10', 'Top_comment_bigram11', 'Top_comment_bigram12', 'Top_comment_bigram13', 'Top_comment_bigram14', 'Top_comment_bigram15', 'Top_comment_bigram16', 'Top_comment_bigram17', 'Top_comment_bigram18', 'Top_comment_bigram19', 'Top_comment_bigram20', 'Top_comment_bigram21', 'Top_comment_bigram22', 'Top_comment_bigram23', 'Top_comment_bigram24', 'Top_comment_bigram25', 'Top_comment_bigram26', 'Top_comment_bigram27', 'Top_comment_bigram28', 'Top_comment_bigram29', 'Top_comment_bigram30', 'Top_comment_bigram31', 'Top_comment_bigram32', 'Top_comment_bigram33', 'Top_comment_bigram34', 'Top_comment_bigram35', 'Top_comment_bigram36', 'Top_comment_bigram37', 'Top_comment_bigram38', 'Top_comment_bigram39', 'Top_comment_bigram40', 'Top_comment_bigram41', 'Top_comment_bigram42', 'Top_comment_bigram43', 'Top_comment_bigram44', 'Top_comment_bigram45', 'Top_comment_bigram46', 'Top_comment_bigram47', 'Top_comment_bigram48', 'Top_comment_bigram49', 'Top_comment_bigram50', 'Top_comment_bigram51', 'Top_comment_bigram52', 'Top_comment_bigram53', 'Top_comment_bigram54', 'Top_comment_bigram55', 'Top_comment_bigram56', 'Top_comment_bigram57', 'Top_comment_bigram58', 'Top_comment_bigram59', 'Top_comment_bigram60', 'Top_comment_bigram61', 'Top_comment_bigram62', 'Top_comment_bigram63', 'Top_comment_bigram64', 'Top_comment_bigram65', 'Top_comment_bigram66', 'Top_comment_bigram67', 'Top_comment_bigram68', 'Top_comment_bigram69', 'Top_comment_bigram70', 'Top_comment_bigram71', 'Top_comment_bigram72', 'Top_comment_bigram73', 'Top_comment_bigram74', 'Top_comment_bigram75', 'Top_comment_bigram76', 'Top_comment_bigram77', 'Top_comment_bigram78', 'Top_comment_bigram79', 'Top_comment_bigram80', 'Top_comment_bigram81', 'Top_comment_bigram82', 'Top_comment_bigram83', 'Top_comment_bigram84', 'Top_comment_bigram85', 'Top_comment_bigram86', 'Top_comment_bigram87', 'Top_comment_bigram88', 'Top_comment_bigram89', 'Top_comment_bigram90', 'Top_comment_bigram91', 'Top_comment_bigram92', 'Top_comment_bigram93', 'Top_comment_bigram94', 'Top_comment_bigram95', 'Top_comment_bigram96', 'Top_comment_bigram97', 'Top_comment_bigram98', 'Top_comment_bigram99', 'Top_comment_bigram100', 'Top_comment_bigram101', 'Top_comment_bigram102', 'Top_comment_bigram103', 'Top_comment_bigram104', 'Top_comment_bigram105', 'Top_comment_bigram106', 'Top_comment_bigram107', 'Top_comment_bigram108', 'Top_comment_bigram109', 'Top_comment_bigram110', 'Top_comment_bigram111', 'Top_comment_bigram112', 'Top_comment_bigram113', 'Top_comment_bigram114', 'Top_comment_bigram115', 'Top_comment_bigram116', 'Top_comment_bigram117', 'Top_comment_bigram118', 'Top_comment_bigram119', 'Top_comment_bigram120', 'Top_comment_bigram121', 'Top_comment_bigram122', 'Top_comment_bigram123', 'Top_comment_bigram124', 'Top_comment_bigram125', 'Top_comment_bigram126', 'Top_comment_bigram127', 'Top_comment_bigram128', 'Top_comment_bigram129', 'Top_comment_bigram130', 'Top_comment_bigram131', 'Top_comment_bigram132', 'Top_comment_bigram133', 'Top_comment_bigram134', 'Top_comment_bigram135', 'Top_comment_bigram136', 'Top_comment_bigram137', 'Top_comment_bigram138', 'Top_comment_bigram139', 'Top_comment_bigram140', 'Top_comment_bigram141', 'Top_comment_bigram142', 'Top_comment_bigram143', 'Top_comment_bigram144', 'Top_comment_bigram145', 'Top_comment_bigram146', 'Top_comment_bigram147', 'Top_comment_bigram148', 'Top_comment_bigram149', 'Top_comment_bigram150', 'Top_comment_bigram151', 'Top_comment_bigram152', 'Top_comment_bigram153', 'Top_comment_bigram154', 'Top_comment_bigram155', 'Top_comment_bigram156', 'Top_comment_bigram157', 'Top_comment_bigram158', 'Top_comment_bigram159', 'Top_comment_bigram160', 'Top_comment_bigram161', 'Top_comment_bigram162', 'Top_comment_bigram163', 'Top_comment_bigram164', 'Top_comment_bigram165', 'Top_comment_bigram166', 'Top_comment_bigram167', 'Top_comment_bigram168', 'Top_comment_bigram169', 'Top_comment_bigram170', 'Top_comment_bigram171', 'Top_comment_bigram172', 'Top_comment_bigram173', 'Top_comment_bigram174', 'Top_comment_bigram175', 'Top_comment_bigram176', 'Top_comment_bigram177', 'Top_comment_bigram178', 'Top_comment_bigram179', 'Top_comment_bigram180', 'Top_comment_bigram181', 'Top_comment_bigram182', 'Top_comment_bigram183', 'Top_comment_bigram184', 'Top_comment_bigram185', 'Top_comment_bigram186', 'Top_comment_bigram187', 'Top_comment_bigram188', 'Top_comment_bigram189', 'Top_comment_bigram190', 'Top_comment_bigram191', 'Top_comment_bigram192', 'Top_comment_bigram193', 'Top_comment_bigram194', 'Top_comment_bigram195', 'Top_comment_bigram196', 'Top_comment_bigram197', 'Top_comment_bigram198', 'Top_comment_bigram199', 'Top_comment_bigram200', 'Top_comment_bigram201', 'Top_comment_bigram202', 'Top_comment_bigram203', 'Top_comment_bigram204', 'Top_comment_bigram205', 'Top_comment_bigram206', 'Top_comment_bigram207', 'Top_comment_bigram208', 'Top_comment_bigram209', 'Top_comment_bigram210', 'Top_comment_bigram211', 'Top_comment_bigram212', 'Top_comment_bigram213', 'Top_comment_bigram214', 'Top_comment_bigram215', 'Top_comment_bigram216', 'Top_comment_bigram217', 'Top_comment_bigram218', 'Top_comment_bigram219', 'Top_comment_bigram220', 'Top_comment_bigram221', 'Top_comment_bigram222', 'Top_comment_bigram223', 'Top_comment_bigram224', 'Top_comment_bigram225', 'Top_comment_bigram226', 'Top_comment_bigram227', 'Top_comment_bigram228', 'Top_comment_bigram229', 'Top_comment_bigram230', 'Top_comment_bigram231', 'Top_comment_bigram232', 'Top_comment_bigram233', 'Top_comment_bigram234', 'Top_comment_bigram235', 'Top_comment_bigram236', 'Top_comment_bigram237', 'Top_comment_bigram238', 'Top_comment_bigram239', 'Top_comment_bigram240', 'Top_comment_bigram241', 'Top_comment_bigram242', 'Top_comment_bigram243', 'Top_comment_bigram244', 'Top_comment_bigram245', 'Top_comment_bigram246', 'Top_comment_bigram247', 'Top_comment_bigram248', 'Top_comment_bigram249', 'Top_comment_bigram250', 'Top_comment_bigram251', 'Top_comment_bigram252', 'Top_comment_bigram253', 'Top_comment_bigram254', 'Top_comment_bigram255', 'Top_comment_bigram256', 'Top_comment_bigram257', 'Top_comment_bigram258', 'Top_comment_bigram259', 'Top_comment_bigram260', 'Top_comment_bigram261', 'Top_comment_bigram262', 'Top_comment_bigram263', 'Top_comment_bigram264', 'Top_comment_bigram265', 'Top_comment_bigram266', 'Top_comment_bigram267', 'Top_comment_bigram268', 'Top_comment_bigram269', 'Top_comment_bigram270', 'Top_comment_bigram271', 'Top_comment_bigram272', 'Top_comment_bigram273', 'Top_comment_bigram274', 'Top_comment_bigram275', 'Top_comment_bigram276', 'Top_comment_bigram277', 'Top_comment_bigram278', 'Top_comment_bigram279', 'Top_comment_bigram280', 'Top_comment_bigram281', 'Top_comment_bigram282', 'Top_comment_bigram283', 'Top_comment_bigram284', 'Top_comment_bigram285', 'Top_comment_bigram286', 'Top_comment_bigram287', 'Top_comment_bigram288', 'Top_comment_bigram289', 'Top_comment_bigram290', 'Top_comment_bigram291', 'Top_comment_bigram292', 'Top_comment_bigram293', 'Top_comment_bigram294', 'Top_comment_bigram295', 'Top_comment_bigram296', 'Top_comment_bigram297', 'Top_comment_bigram298', 'Top_comment_bigram299', 'Top_comment_bigram300', 'Top_comment_bigram301', 'Top_comment_bigram302', 'Top_comment_bigram303', 'Top_comment_bigram304', 'Top_comment_bigram305', 'Top_comment_bigram306', 'Top_comment_bigram307', 'Top_comment_bigram308', 'Top_comment_bigram309', 'Top_comment_bigram310', 'Top_comment_bigram311', 'Top_comment_bigram312', 'Top_comment_bigram313', 'Top_comment_bigram314', 'Top_comment_bigram315', 'Top_comment_bigram316', 'Top_comment_bigram317', 'Top_comment_bigram318', 'Top_comment_bigram319', 'Top_comment_bigram320', 'Top_comment_bigram321', 'Top_comment_bigram322', 'Top_comment_bigram323', 'Top_comment_bigram324', 'Top_comment_bigram325', 'Top_comment_bigram326', 'Top_comment_bigram327', 'Top_comment_bigram328', 'Top_comment_bigram329', 'Top_comment_bigram330', 'Top_comment_bigram331', 'Top_comment_bigram332', 'Top_comment_bigram333', 'Top_comment_bigram334', 'Top_comment_bigram335', 'Top_comment_bigram336', 'Top_comment_bigram337', 'Top_comment_bigram338', 'Top_comment_bigram339', 'Top_comment_bigram340', 'Top_comment_bigram341', 'Top_comment_bigram342', 'Top_comment_bigram343', 'Top_comment_bigram344', 'Top_comment_bigram345', 'Top_comment_bigram346', 'Top_comment_bigram347', 'Top_comment_bigram348', 'Top_comment_bigram349', 'Top_comment_bigram350', 'Top_comment_bigram351', 'Top_comment_bigram352', 'Top_comment_bigram353', 'Top_comment_bigram354', 'Top_comment_bigram355', 'Top_comment_bigram356', 'Top_comment_bigram357', 'Top_comment_bigram358', 'Top_comment_bigram359', 'Top_comment_bigram360', 'Top_comment_bigram361', 'Top_comment_bigram362', 'Top_comment_bigram363', 'Top_comment_bigram364', 'Top_comment_bigram365', 'Top_comment_bigram366', 'Top_comment_bigram367', 'Top_comment_bigram368', 'Top_comment_bigram369', 'Top_comment_bigram370', 'Top_comment_bigram371', 'Top_comment_bigram372', 'Top_comment_bigram373', 'Top_comment_bigram374', 'Top_comment_bigram375', 'Top_comment_bigram376', 'Top_comment_bigram377', 'Top_comment_bigram378', 'Top_comment_bigram379', 'Top_comment_bigram380', 'Top_comment_bigram381', 'Top_comment_bigram382', 'Top_comment_bigram383', 'Top_comment_bigram384', 'Top_comment_bigram385', 'Top_comment_bigram386', 'Top_comment_bigram387', 'Top_comment_bigram388', 'Top_comment_bigram389', 'Top_comment_bigram390', 'Top_comment_bigram391', 'Top_comment_bigram392', 'Top_comment_bigram393', 'Top_comment_bigram394', 'Top_comment_bigram395', 'Top_comment_bigram396', 'Top_comment_bigram397', 'Top_comment_bigram398', 'Top_comment_bigram399', 'Top_comment_bigram400', 'Top_comment_bigram401', 'Top_comment_bigram402', 'Top_comment_bigram403', 'Top_comment_bigram404', 'Top_comment_bigram405', 'Top_comment_bigram406', 'Top_comment_bigram407', 'Top_comment_bigram408', 'Top_comment_bigram409', 'Top_comment_bigram410', 'Top_comment_bigram411', 'Top_comment_bigram412', 'Top_comment_bigram413', 'Top_comment_bigram414', 'Top_comment_bigram415', 'Top_comment_bigram416', 'Top_comment_bigram417', 'Top_comment_bigram418', 'Top_comment_bigram419', 'Top_comment_bigram420', 'Top_comment_bigram421', 'Top_comment_bigram422', 'Top_comment_bigram423', 'Top_comment_bigram424', 'Top_comment_bigram425', 'Top_comment_bigram426', 'Top_comment_bigram427', 'Top_comment_bigram428', 'Top_comment_bigram429', 'Top_comment_bigram430', 'Top_comment_bigram431', 'Top_comment_bigram432', 'Top_comment_bigram433', 'Top_comment_bigram434', 'Top_comment_bigram435', 'Top_comment_bigram436', 'Top_comment_bigram437', 'Top_comment_bigram438', 'Top_comment_bigram439', 'Top_comment_bigram440', 'Top_comment_bigram441', 'Top_comment_bigram442', 'Top_comment_bigram443', 'Top_comment_bigram444', 'Top_comment_bigram445', 'Top_comment_bigram446', 'Top_comment_bigram447', 'Top_comment_bigram448', 'Top_comment_bigram449', 'Top_comment_bigram450', 'Top_comment_bigram451', 'Top_comment_bigram452', 'Top_comment_bigram453', 'Top_comment_bigram454', 'Top_comment_bigram455', 'Top_comment_bigram456', 'Top_comment_bigram457', 'Top_comment_bigram458', 'Top_comment_bigram459', 'Top_comment_bigram460', 'Top_comment_bigram461', 'Top_comment_bigram462', 'Top_comment_bigram463', 'Top_comment_bigram464', 'Top_comment_bigram465', 'Top_comment_bigram466', 'Top_comment_bigram467', 'Top_comment_bigram468', 'Top_comment_bigram469', 'Top_comment_bigram470', 'Top_comment_bigram471', 'Top_comment_bigram472', 'Top_comment_bigram473', 'Top_comment_bigram474', 'Top_comment_bigram475', 'Top_comment_bigram476', 'Top_comment_bigram477', 'Top_comment_bigram478', 'Top_comment_bigram479', 'Top_comment_bigram480', 'Top_comment_bigram481', 'Top_comment_bigram482', 'Top_comment_bigram483', 'Top_comment_bigram484', 'Top_comment_bigram485', 'Top_comment_bigram486', 'Top_comment_bigram487', 'Top_comment_bigram488', 'Top_comment_bigram489', 'Top_comment_bigram490', 'Top_comment_bigram491', 'Top_comment_bigram492', 'Top_comment_bigram493', 'Top_comment_bigram494', 'Top_comment_bigram495', 'Top_comment_bigram496', 'Top_comment_bigram497', 'Top_comment_bigram498', 'Top_comment_bigram499', 'Top_comment_bigram500', 'Top_comment_bigram501', 'Top_comment_bigram502', 'Top_comment_bigram503', 'Top_comment_bigram504', 'Top_comment_bigram505', 'Top_comment_bigram506', 'Top_comment_bigram507', 'Top_comment_bigram508', 'Top_comment_bigram509', 'Top_comment_bigram510', 'Top_comment_bigram511', 'Top_comment_bigram512', 'Top_comment_bigram513', 'Top_comment_bigram514', 'Top_comment_bigram515', 'Top_comment_bigram516', 'Top_comment_bigram517', 'Top_comment_bigram518', 'Top_comment_bigram519', 'Top_comment_bigram520', 'Top_comment_bigram521', 'Top_comment_bigram522', 'Top_comment_bigram523', 'Top_comment_bigram524', 'Top_comment_bigram525', 'Top_comment_bigram526', 'Top_comment_bigram527', 'Top_comment_bigram528', 'Top_comment_bigram529', 'Top_comment_bigram530', 'Top_comment_bigram531', 'Top_comment_bigram532', 'Top_comment_bigram533', 'Top_comment_bigram534', 'Top_comment_bigram535', 'Top_comment_bigram536', 'Top_comment_bigram537', 'Top_comment_bigram538', 'Top_comment_bigram539', 'Top_comment_bigram540', 'Top_comment_bigram541', 'Top_comment_bigram542', 'Top_comment_bigram543', 'Top_comment_bigram544', 'Top_comment_bigram545', 'Top_comment_bigram546', 'Top_comment_bigram547', 'Top_comment_bigram548', 'Top_comment_bigram549', 'Top_comment_bigram550', 'Top_comment_bigram551', 'Top_comment_bigram552', 'Top_comment_bigram553', 'Top_comment_bigram554', 'Top_comment_bigram555', 'Top_comment_bigram556', 'Top_comment_bigram557', 'Top_comment_bigram558', 'Top_comment_bigram559', 'Top_comment_bigram560', 'Top_comment_bigram561', 'Top_comment_bigram562', 'Top_comment_bigram563', 'Top_comment_bigram564', 'Top_comment_bigram565', 'Top_comment_bigram566', 'Top_comment_bigram567', 'Top_comment_bigram568', 'Top_comment_bigram569', 'Top_comment_bigram570', 'Top_comment_bigram571', 'Top_comment_bigram572', 'Top_comment_bigram573', 'Top_comment_bigram574', 'Top_comment_bigram575', 'Top_comment_bigram576', 'Top_comment_bigram577', 'Top_comment_bigram578', 'Top_comment_bigram579', 'Top_comment_bigram580', 'Top_comment_bigram581', 'Top_comment_bigram582', 'Top_comment_bigram583', 'Top_comment_bigram584', 'Top_comment_bigram585', 'Top_comment_bigram586', 'Top_comment_bigram587', 'Top_comment_bigram588', 'Top_comment_bigram589', 'Top_comment_bigram590', 'Top_comment_bigram591', 'Top_comment_bigram592', 'Top_comment_bigram593', 'Top_comment_bigram594', 'Top_comment_bigram595', 'Top_comment_bigram596', 'Top_comment_bigram597', 'Top_comment_bigram598', 'Top_comment_bigram599', 'Top_comment_bigram600', 'Top_comment_bigram601', 'Top_comment_bigram602', 'Top_comment_bigram603', 'Top_comment_bigram604', 'Top_comment_bigram605', 'Top_comment_bigram606', 'Top_comment_bigram607', 'Top_comment_bigram608', 'Top_comment_bigram609', 'Top_comment_bigram610', 'Top_comment_bigram611', 'Top_comment_bigram612', 'Top_comment_bigram613', 'Top_comment_bigram614', 'Top_comment_bigram615', 'Top_comment_bigram616', 'Top_comment_bigram617', 'Top_comment_bigram618', 'Top_comment_bigram619', 'Top_comment_bigram620', 'Top_comment_bigram621', 'Top_comment_bigram622', 'Top_comment_bigram623', 'Top_comment_bigram624', 'Top_comment_bigram625', 'Top_comment_bigram626', 'Top_comment_bigram627', 'Top_comment_bigram628', 'Top_comment_bigram629', 'Top_comment_bigram630', 'Top_comment_bigram631', 'Top_comment_bigram632', 'Top_comment_bigram633', 'Top_comment_bigram634', 'Top_comment_bigram635', 'Top_comment_bigram636', 'Top_comment_bigram637', 'Top_comment_bigram638', 'Top_comment_bigram639', 'Top_comment_bigram640', 'Top_comment_bigram641', 'Top_comment_bigram642', 'Top_comment_bigram643', 'Top_comment_bigram644', 'Top_comment_bigram645', 'Top_comment_bigram646', 'Top_comment_bigram647', 'Top_comment_bigram648', 'Top_comment_bigram649', 'Top_comment_bigram650', 'Top_comment_bigram651', 'Top_comment_bigram652', 'Top_comment_bigram653', 'Top_comment_bigram654', 'Top_comment_bigram655', 'Top_comment_bigram656', 'Top_comment_bigram657', 'Top_comment_bigram658', 'Top_comment_bigram659', 'Top_comment_bigram660', 'Top_comment_bigram661', 'Top_comment_bigram662', 'Top_comment_bigram663', 'Top_comment_bigram664', 'Top_comment_bigram665', 'Top_comment_bigram666', 'Top_comment_bigram667', 'Top_comment_bigram668', 'Top_comment_bigram669', 'Top_comment_bigram670', 'Top_comment_bigram671', 'Top_comment_bigram672', 'Top_comment_bigram673', 'Top_comment_bigram674', 'Top_comment_bigram675', 'Top_comment_bigram676', 'Top_comment_bigram677', 'Top_comment_bigram678', 'Top_comment_bigram679', 'Top_comment_bigram680', 'Top_comment_bigram681', 'Top_comment_bigram682', 'Top_comment_bigram683', 'Top_comment_bigram684', 'Top_comment_bigram685', 'Top_comment_bigram686', 'Top_comment_bigram687', 'Top_comment_bigram688', 'Top_comment_bigram689', 'Top_comment_bigram690', 'Top_comment_bigram691', 'Top_comment_bigram692', 'Top_comment_bigram693', 'Top_comment_bigram694', 'Top_comment_bigram695', 'Top_comment_bigram696', 'Top_comment_bigram697', 'Top_comment_bigram698', 'Top_comment_bigram699', 'Top_comment_bigram700', 'Top_comment_bigram701', 'Top_comment_bigram702', 'Top_comment_bigram703', 'Top_comment_bigram704', 'Top_comment_bigram705', 'Top_comment_bigram706', 'Top_comment_bigram707', 'Top_comment_bigram708', 'Top_comment_bigram709', 'Top_comment_bigram710', 'Top_comment_bigram711', 'Top_comment_bigram712', 'Top_comment_bigram713', 'Top_comment_bigram714', 'Top_comment_bigram715', 'Top_comment_bigram716', 'Top_comment_bigram717', 'Top_comment_bigram718', 'Top_comment_bigram719', 'Top_comment_bigram720', 'Top_comment_bigram721', 'Top_comment_bigram722', 'Top_comment_bigram723', 'Top_comment_bigram724', 'Top_comment_bigram725', 'Top_comment_bigram726', 'Top_comment_bigram727', 'Top_comment_bigram728', 'Top_comment_bigram729', 'Top_comment_bigram730', 'Top_comment_bigram731', 'Top_comment_bigram732', 'Top_comment_bigram733', 'Top_comment_bigram734', 'Top_comment_bigram735', 'Top_comment_bigram736', 'Top_comment_bigram737', 'Top_comment_bigram738', 'Top_comment_bigram739', 'Top_comment_bigram740', 'Top_comment_bigram741', 'Top_comment_bigram742', 'Top_comment_bigram743', 'Top_comment_bigram744', 'Top_comment_bigram745', 'Top_comment_bigram746', 'Top_comment_bigram747', 'Top_comment_bigram748', 'Top_comment_bigram749', 'Top_comment_bigram750', 'Top_comment_bigram751', 'Top_comment_bigram752', 'Top_comment_bigram753', 'Top_comment_bigram754', 'Top_comment_bigram755', 'Top_comment_bigram756', 'Top_comment_bigram757', 'Top_comment_bigram758', 'Top_comment_bigram759', 'Top_comment_bigram760', 'Top_comment_bigram761', 'Top_comment_bigram762', 'Top_comment_bigram763', 'Top_comment_bigram764', 'Top_comment_bigram765', 'Top_comment_bigram766', 'Top_comment_bigram767', 'Top_comment_bigram768', 'Top_comment_bigram769', 'Top_comment_bigram770', 'Top_comment_bigram771', 'Top_comment_bigram772', 'Top_comment_bigram773', 'Top_comment_bigram774', 'Top_comment_bigram775', 'Top_comment_bigram776', 'Top_comment_bigram777', 'Top_comment_bigram778', 'Top_comment_bigram779', 'Top_comment_bigram780', 'Top_comment_bigram781', 'Top_comment_bigram782', 'Top_comment_bigram783', 'Top_comment_bigram784', 'Top_comment_bigram785', 'Top_comment_bigram786', 'Top_comment_bigram787', 'Top_comment_bigram788', 'Top_comment_bigram789', 'Top_comment_bigram790', 'Top_comment_bigram791', 'Top_comment_bigram792', 'Top_comment_bigram793', 'Top_comment_bigram794', 'Top_comment_bigram795', 'Top_comment_bigram796', 'Top_comment_bigram797', 'Top_comment_bigram798', 'Top_comment_bigram799', 'Top_comment_bigram800', 'Top_comment_bigram801', 'Top_comment_bigram802', 'Top_comment_bigram803', 'Top_comment_bigram804', 'Top_comment_bigram805', 'Top_comment_bigram806', 'Top_comment_bigram807', 'Top_comment_bigram808', 'Top_comment_bigram809', 'Top_comment_bigram810', 'Top_comment_bigram811', 'Top_comment_bigram812', 'Top_comment_bigram813', 'Top_comment_bigram814', 'Top_comment_bigram815', 'Top_comment_bigram816', 'Top_comment_bigram817', 'Top_comment_bigram818', 'Top_comment_bigram819', 'Top_comment_bigram820', 'Top_comment_bigram821', 'Top_comment_bigram822', 'Top_comment_bigram823', 'Top_comment_bigram824', 'Top_comment_bigram825', 'Top_comment_bigram826', 'Top_comment_bigram827', 'Top_comment_bigram828', 'Top_comment_bigram829', 'Top_comment_bigram830', 'Top_comment_bigram831', 'Top_comment_bigram832', 'Top_comment_bigram833', 'Top_comment_bigram834', 'Top_comment_bigram835', 'Top_comment_bigram836', 'Top_comment_bigram837', 'Top_comment_bigram838', 'Top_comment_bigram839', 'Top_comment_bigram840', 'Top_comment_bigram841', 'Top_comment_bigram842', 'Top_comment_bigram843', 'Top_comment_bigram844', 'Top_comment_bigram845', 'Top_comment_bigram846', 'Top_comment_bigram847', 'Top_comment_bigram848', 'Top_comment_bigram849', 'Top_comment_bigram850', 'Top_comment_bigram851', 'Top_comment_bigram852', 'Top_comment_bigram853', 'Top_comment_bigram854', 'Top_comment_bigram855', 'Top_comment_bigram856', 'Top_comment_bigram857', 'Top_comment_bigram858', 'Top_comment_bigram859', 'Top_comment_bigram860', 'Top_comment_bigram861', 'Top_comment_bigram862', 'Top_comment_bigram863', 'Top_comment_bigram864', 'Top_comment_bigram865', 'Top_comment_bigram866', 'Top_comment_bigram867', 'Top_comment_bigram868', 'Top_comment_bigram869', 'Top_comment_bigram870', 'Top_comment_bigram871', 'Top_comment_bigram872', 'Top_comment_bigram873', 'Top_comment_bigram874', 'Top_comment_bigram875', 'Top_comment_bigram876', 'Top_comment_bigram877', 'Top_comment_bigram878', 'Top_comment_bigram879', 'Top_comment_bigram880', 'Top_comment_bigram881', 'Top_comment_bigram882', 'Top_comment_bigram883', 'Top_comment_bigram884', 'Top_comment_bigram885', 'Top_comment_bigram886', 'Top_comment_bigram887', 'Top_comment_bigram888', 'Top_comment_bigram889', 'Top_comment_bigram890', 'Top_comment_bigram891', 'Top_comment_bigram892', 'Top_comment_bigram893', 'Top_comment_bigram894', 'Top_comment_bigram895', 'Top_comment_bigram896', 'Top_comment_bigram897', 'Top_comment_bigram898', 'Top_comment_bigram899', 'Top_comment_bigram900', 'Top_comment_bigram901', 'Top_comment_bigram902', 'Top_comment_bigram903', 'Top_comment_bigram904', 'Top_comment_bigram905', 'Top_comment_bigram906', 'Top_comment_bigram907', 'Top_comment_bigram908', 'Top_comment_bigram909', 'Top_comment_bigram910', 'Top_comment_bigram911', 'Top_comment_bigram912', 'Top_comment_bigram913', 'Top_comment_bigram914', 'Top_comment_bigram915', 'Top_comment_bigram916', 'Top_comment_bigram917', 'Top_comment_bigram918', 'Top_comment_bigram919', 'Top_comment_bigram920', 'Top_comment_bigram921', 'Top_comment_bigram922', 'Top_comment_bigram923', 'Top_comment_bigram924', 'Top_comment_bigram925', 'Top_comment_bigram926', 'Top_comment_bigram927', 'Top_comment_bigram928', 'Top_comment_bigram929', 'Top_comment_bigram930', 'Top_comment_bigram931', 'Top_comment_bigram932', 'Top_comment_bigram933', 'Top_comment_bigram934', 'Top_comment_bigram935', 'Top_comment_bigram936', 'Top_comment_bigram937', 'Top_comment_bigram938', 'Top_comment_bigram939', 'Top_comment_bigram940', 'Top_comment_bigram941', 'Top_comment_bigram942', 'Top_comment_bigram943', 'Top_comment_bigram944', 'Top_comment_bigram945', 'Top_comment_bigram946', 'Top_comment_bigram947', 'Top_comment_bigram948', 'Top_comment_bigram949', 'Top_comment_bigram950', 'Top_comment_bigram951', 'Top_comment_bigram952', 'Top_comment_bigram953', 'Top_comment_bigram954', 'Top_comment_bigram955', 'Top_comment_bigram956', 'Top_comment_bigram957', 'Top_comment_bigram958', 'Top_comment_bigram959', 'Top_comment_bigram960', 'Top_comment_bigram961', 'Top_comment_bigram962', 'Top_comment_bigram963', 'Top_comment_bigram964', 'Top_comment_bigram965', 'Top_comment_bigram966', 'Top_comment_bigram967', 'Top_comment_bigram968', 'Top_comment_bigram969', 'Top_comment_bigram970', 'Top_comment_bigram971', 'Top_comment_bigram972', 'Top_comment_bigram973', 'Top_comment_bigram974', 'Top_comment_bigram975', 'Top_comment_bigram976', 'Top_comment_bigram977', 'Top_comment_bigram978', 'Top_comment_bigram979', 'Top_comment_bigram980', 'Top_comment_bigram981', 'Top_comment_bigram982', 'Top_comment_bigram983', 'Top_comment_bigram984', 'Top_comment_bigram985', 'Top_comment_bigram986', 'Top_comment_bigram987', 'Top_comment_bigram988', 'Top_comment_bigram989', 'Top_comment_bigram990', 'Top_comment_bigram991', 'Top_comment_bigram992', 'Top_comment_bigram993', 'Top_comment_bigram994', 'Top_comment_bigram995', 'Top_comment_bigram996', 'Top_comment_bigram997', 'Top_comment_bigram998', 'Top_comment_bigram999'] outcomes = ['Replies_informative_count', 'Replies_links_count', 'Replies_max_depth', 'Replies_sum_score', 'Replies_total_number', 'Top_comment_article_accommodation', 'Top_comment_certain_accommodation', 'Top_comment_conj_accommodation', 'Top_comment_discrep_accommodation', 'Top_comment_excl_accommodation', 'Top_comment_incl_accommodation', 'Top_comment_ipron_accommodation', 'Top_comment_negate_accommodation', 'Top_comment_quant_accommodation', 'Top_comment_tentat_accommodation', 'Replies_advice_count', 'Replies_laughter_count', 'Replies_gratitude_count', 'Replies_informative_URL_count', 'Replies_i_language_count', 'Replies_compliments_count', 'Replies_untuned_toxicity_children_count', 'Top_comment_direct_children', 'Replies_distinct_pairs_of_sustained_conversation', 'Replies_max_turns_of_sustained_conversations', 'Replies_untuned_non_toxic_percentage'] albert_eigenmetrics = ['PC0'] eigenmetrics = ['PC0'] albert_subreddit_header = 'Top_comment_subreddit' albert_top_comment_text_header = 'Top_comment_text' albert_post_text_header = 'Post_text' roberta_top_comment_text_header = 'Top_comment_text' roberta_eigenmetrics = 'PC0' primary_key = 'Top_comment_id' generic_token = '<GENERIC>' generic_id = 0 num_subreddit_embeddings = 11993 subreddit_embeddings_size = 16 annotation_albert_tlc_text_header = ALBERT_TOP_COMMENT_TEXT_HEADER annotation_albert_post_text_header = ALBERT_POST_TEXT_HEADER annotation_albert_subreddit_header = ALBERT_SUBREDDIT_HEADER annotation_albert_meta_features = ALBERT_META_FEATURES annotation_albert_label_header = 'human_label' baseline_annotation_model_tlc_text_header = 'Top_comment_text' baseline_annotation_model_label_header = 'human_label' annotation_xgboost_meta_features = XGBOOST_FEATURES annotation_xgboost_labels_header = 'human_label'