import re from openstates.utils.actions import Rule, BaseCategorizer rules = ( Rule([('(?P<yes_votes>\d+) Yeas - (?P<no_votes>\d+) ' 'Nays- (?P<excused>\d+) Excused - (?P<absent>\d+) Absent'), ('(?P<yes_votes>\d+) -Yeas, (?P<no_votes>\d+) -Nays, ' '(?P<excused>\d+) -Excused, (?P<absent>\d+) -Absent'), '(?P<committees>Committee on .+?) suggested and ordered printed', ('\(Yeas (?P<yes_votes>\d+) - Nays (?P<no_votes>\d+) - Absent ' '(?P<absent>\d+) - Excused (?P<excused>\d+)\)( \(Vacancy ' '(?P<vacant>\d+)\))?')]), Rule(['Representative (?P<legislators>.+?) of \S+', 'Senator (?P<legislators>.+?of \S+)', 'Representative (?P<legislators>[A-Z]+?( of [A-Za-z]+))', 'Senator (?P<legislators>\S+ of \S+)', 'Representative [A-Z ]+? of \S+']), Rule('REFERRED to the (?P<committees>Committee on [A-Z ]+(?![a-z]))', 'referral-committee'), Rule(['READ A SECOND TIME'], ['reading-2']), Rule(['(?i)read once'], ['reading-1']), Rule('(?i)finally passed', 'passage'), Rule('(?i)passed to be enacted', 'passage'), Rule('COMMITTED to the (?P<committees>Committee on .+?)\.', 'referral-committee'), Rule(r'Sent to the Engrossing Department', 'became-law'), Rule(r'VETO was NOT SUSTAINED', 'veto-override-passage'), Rule(r'VETO was OVERRIDDEN', 'veto-override-passage'),
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule((r'\(Ayes (?P<yes_votes>\d+)\.\s+Noes\s+' r'(?P<no_votes>\d+)\.( Page \S+\.)?\)')), Rule(r'^Introduced', 'introduction'), Rule(r'(?i)Referred to (?P<committees>.+)', 'referral-committee'), Rule(r'(?i)Referred to (?P<committees>.+?)(\.\s+suspense)', 'referral-committee'), Rule(r're-refer to Standing (?P<committees>[^.]+)\.', 'referral-committee'), Rule(r'Read first time\.', 'reading-1'), Rule(r'Read second time and amended', ['reading-2']), Rule(r'Read third time', 'reading-3'), Rule(r'Read third time. Refused passage\.', 'failure'), Rule([r'(?i)read third time.{,5}passed', r'(?i)Read third time.+?Passed'], ['passage', 'reading-3']), Rule(r'Approved by the Governor', 'executive-signature'), Rule(r'Approved by the Governor with item veto', 'executive-veto-line-item'), Rule('Vetoed by Governor', 'executive-veto'),
u'State, Veterans, (?:and|&) Military Affairs', u'Executive Committee of Legislative Council', u'Health (?:and|&) Environment', u'Finance', u'Appropriations', u'Agriculture, Natural Resources (?:and|&) Energy', u'Judiciary', u'Business, Labor (?:and|&) Technology', u'Health (?:and|&) Human Services', u'State, Veterans (?:and|&) Military Affairs', u'Local Government', u'Legislative Audit', u'Executive Committee of Legislative Council', u'Transportation', u'Health (?:and|&) Human Services', u'Education', u'Legislative Council', u'Legal Services', u'Capital Development', u'Transportation (?:and|&) Energy', u'Joint Budget Committee', u'Business, Labor, (?:and|&) Technology', u'State, Veterans, (?:and|&) Military Affairs' ] rules = (Rule('^House', actor='lower'), Rule('^Senate', actor='upper'), Rule('^Introduced in Senate', actor='upper'), Rule('^Introduced in House', actor='lower'), Rule('^Governor', actor='executive'), Rule('Governor Action - Partial Veto', 'executive-veto-line-item'), Rule('Sent to the Governor', 'executive-receipt'), Rule('Governor Action - Signed', 'executive-signature'), Rule('Governor Signed', 'executive-signature'), Rule('Governor Action - Vetoed', 'executive-veto'), Rule(r'^Introduced', 'introduction'), Rule(r'Assigned to (?P<committees>.+)'), Rule(u'(?i)refer (un)?amended to (?P<committees>.+)', [u'referral-committee']), Rule(u'(?i)\S+ Committee on (?P<committees>.+?) Refer (un)amended'), Rule(u'Assigned to (<?P<committees>.+?)', 'referral-committee'), Rule(u'Second Reading Passed', [u'reading-2']),
import re from openstates.utils.actions import Rule, BaseCategorizer rules = ( Rule([u'Amendment (?P<bills>.+?) -\s+Laid On Table'], ['amendment-deferral']), Rule([u'Favorable'], ['committee-passage-favorable']), Rule([u'(?i)Amendment (?P<bills>.+?) defeated'], ['amendment-failure']), Rule([u'(?i)introduced and adopted in lieu of (?P<bills>.+)'], ['introduction']), Rule([u'(?i)assigned to (?P<committees>.+?) Committee in'], ['referral-committee', 'introduction']), Rule([u'Signed by Governor'], ['executive-signature']), Rule([u'(?i)Amendment (?P<bills>[\w\s]+?) Introduced'], ['amendment-introduction']), Rule([u'Amendment (?P<bills>.+?) - Passed'], ['amendment-passage']), Rule([u'(?i)^Passed by'], ['passage']), Rule([u'^Defeated'], ['failure' ]), Rule([u'(?i)unfavorable'], ['committee-passage-unfavorable']), Rule([u'Reported Out of Committee \((?P<committees>.+?)\)'], ['committee-passage']), Rule([u'Vetoed by Governor'], ['executive-veto']), Rule([u'(?i)Amendment (?P<bills>.+?)\s+-\s+Introduced'], ['amendment-introduction']), Rule([u'(?i)Amendment (?P<bills>[\w\s]+?) Passed'], ['amendment-passage']), Rule([ u'Amendment (?P<bills>.+?) - Defeated by House of .+?\. Votes: Defeated' ], ['amendment-failure']), Rule([u'^Introduced'], ['introduction']), Rule([u'Amendment (?P<bills>.+?) - Defeated in House'],
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule(['Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle YES adopted'], ['amendment-passage']), Rule(['(?i)Signed by (the )Governor(.*)'], ['executive-signature']), Rule(['Accompanied (by )?(?P<bill_id>[SH]\\S+)'], []), Rule(['Discharged to the committee on (?P<committees>.+)'], ['referral-committee']), Rule(['(?i)Amendment #\\d+ adopted'], ['amendment-passage']), Rule(['Amendment #\\d+ \\((?P<legislator>.+?)\\) rejected', '(?i)amendment.+?rejected'], ['amendment-failure']), Rule(['(?is)Amendment \\S+ withdrawn'], ['amendment-withdrawal']), Rule(['Amendment #\\S+ \\((?P<legislator>.+?)\\) Pending'], ['amendment-introduction']), Rule(['(?P<bill>[HS]\\d+)'], []), Rule(['(?i)Amendment \\(#\\d+\\) adopted'], ['amendment-passage']), Rule(['(?i)with veto'], ['executive-veto']), Rule(['reported favorably by committee'], ['committee-passage-favorable']), Rule(['Accompan\\S+ .+?(?P<bill_id>[SH]\\S+)'], []), Rule(['(?i)Amendment \\d+ pending'], ['amendment-deferral']), Rule(['Read,'], ['reading-1']), Rule(['(?i)Amendment #\\S+ \\((?P<legislator>.+?)\\)\\s+-\\s+rejected', '(?i)Amendment \\d+ rejected', 'Amendment #?\\S+ \\((?P<legislator>.+?)\\) rejected'], ['amendment-failure']), Rule(['Amended \\((?P<legislator>.+?)\\) ', 'Amendment #?\\S+ \\((?P<legislator>.+?)\\) adopted'], ['amendment-passage']), Rule(['(?i)read.{,10}second'], ['reading-2']),
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule( ( r"\(Ayes (?P<yes_votes>\d+)\.\s+Noes\s+" r"(?P<no_votes>\d+)\.( Page \S+\.)?\)" ) ), Rule(r"^Introduced", "introduction"), Rule(r"(?i)Referred to (?P<committees>.+)", "referral-committee"), Rule(r"(?i)Referred to (?P<committees>.+?)(\.\s+suspense)", "referral-committee"), Rule(r"re-refer to Standing (?P<committees>[^.]+)\.", "referral-committee"), Rule(r"Read first time\.", "reading-1"), Rule(r"Read second time and amended", ["reading-2"]), Rule(r"Read third time", "reading-3"), Rule(r"Read third time. Refused passage\.", "failure"), Rule( [r"(?i)read third time.{,5}passed", r"(?i)Read third time.+?Passed"], ["passage", "reading-3"], ), Rule(r"Approved by the Governor", "executive-signature"), Rule(r"Approved by the Governor with item veto", "executive-veto-line-item"), Rule("Vetoed by Governor", "executive-veto"), Rule("Vetoed by the Governor", "executive-veto"), Rule(r"To Governor", "executive-receipt"), Rule(r"amendments concurred in", "amendment-passage"), Rule(r"refused to concur in Assembly amendments", "amendment-failure"), Rule(r"Failed passage in committee", "committee-failure"),
u'Regional Jail and Correctional Facility Authority', u'Roads and Transportation', u'Rule-Making Review Committee', u'Senior Citizen Issues', u'Special Investigations', u'Technology', u'Veterans Affairs', u'Veterans Affairs/ Homeland Security', u'Water Resources', u'Workforce Investment for Economic Development', ] committees_rgx = '(%s)' % '|'.join(sorted(committees, key=len, reverse=True)) rules = (Rule( ['Communicated to Senate', 'Senate received', 'Ordered to Senate'], actor='upper'), Rule(['Communicated to House', 'House received', 'Ordered to House'], actor='lower'), Rule('Read 1st time', 'reading-1'), Rule('Read 2nd time', 'reading-2'), Rule('Read 3rd time', 'reading-3'), Rule('Filed for introduction', 'filing'), Rule('^Introduced in', 'introduction'), Rule(['Passed Senate', 'Passed House'], 'passage'), Rule(['Reported do pass', 'With amendment, do pass'], 'committee-passage'), Rule([ u', but first to .+?; then (?P<committees>[^;]+)', u'To (?P<committees>.+?) then' ]), Rule(u'(?i)voice vote', voice_vote=True), Rule([u'Amendment rejected'], [u'amendment-failure']),
u"Roads and Transportation", u"Rule-Making Review Committee", u"Senior Citizen Issues", u"Special Investigations", u"Technology", u"Veterans Affairs", u"Veterans Affairs/ Homeland Security", u"Water Resources", u"Workforce Investment for Economic Development", ] committees_rgx = "(%s)" % "|".join(sorted(committees, key=len, reverse=True)) rules = ( Rule( ["Communicated to Senate", "Senate received", "Ordered to Senate"], actor="upper", ), Rule(["Communicated to House", "House received", "Ordered to House"], actor="lower"), Rule("Read 1st time", "reading-1"), Rule("Read 2nd time", "reading-2"), Rule("Read 3rd time", "reading-3"), Rule("Filed for introduction", "filing"), Rule("^Introduced in", "introduction"), Rule(["Passed Senate", "Passed House"], "passage"), Rule(["Reported do pass", "With amendment, do pass"], "committee-passage"), Rule([ ", but first to .+?; then (?P<committees>[^;]+)", "To (?P<committees>.+?) then", ]), Rule("(?i)voice vote", voice_vote=True),
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule(r'Amendment proposed on floor', 'amendment-introduction'), Rule(r'Amendment failed', 'amendment-failure'), Rule(r'Amendment adopted, placed on calendar', ''), Rule(r'^Filed with ', 'introduction'), Rule(r'^Introduced', 'introduction'), Rule(r'^Second reading', 'reading-2'), Rule(r'passed as amended', 'passage'), Rule(r'passed', 'passage'), Rule(r'Sent to Governor', 'executive-receipt'), Rule(r'Reported back', 'committee-passage'), Rule(r'Reported back.*do pass', 'committee-passage-favorable'), Rule(r'Reported back.*do not pass', 'committee-passage-unfavorable'), Rule(r'^Signed by Governor', 'executive-signature'), ) class NDCategorizer(BaseCategorizer): rules = _categorizer_rules
Rule([ # Add a bajilion links to entities. r'SCs (changed|removed) (?P<legislators>.+)', r'Conference Committee on (?P<committees>.+)', r'Conference granted, naming:?\s+Conference Committee on (?P<committees>.+)', r'vote by Representative(?P<legislators>.+)', r'amended (?P<committees>.+?) committee', r'coauthored by (?P<legislators>.+)', (r'Remove Senator .+? as principal Senate author ' r'and substitute with Senator (?P<legislators>.+?)'), r'(?i)committee substitute (?P<committees>.+)', r'(?i)remove\s{,10}as\s{,10}author\s{,10}(?P<legislators>.+);', r'(?i)SCs\s{,10}named\s{,10}(?P<legislators>.+)', (r'Pending removal author Senator (?P<legislators>.+?) ' r'and replace with Senator'), r'(?i)Representative\(s\)\s{,10}(?P<legislators>.+)', r'Withdrawn from Calendar; (?P<committees>.+)', (r'Pending removal author Senator .+? and replace ' r'with Senator (?P<legislators>.+)'), r'Ayes:\s+(?P<yes_votes>\d+)\s+Nays:\s+(?P<no_votes>\d+)', (r'remove as principal author Representative .+? and substitute ' r'with Representative (?P<legislators>.+?)'), r'Pending coauthorship Senator\(s\) (?P<legislators>.+)', (r'Remove Representative (?P<legislators>.+?) as principal ' r'House author and substitute with Representative'), r'Pending removal principal author Representative .+? and ' r'replace with Representative (?P<legislators>.+)', r'(?i)(co)?authored\s{,10}by\s{,10}(?P<legislators>.+)', r'Second Reading referred to (?P<committees>.+? Committee)', r'Notice served to reconsider vote on measure (?P<legislators>.+)', (r'Pending removal principal author Representative (?P<legislators>.+) ' r'and replace with Representative .+'), (r'remove as principal author Representative (?P<legislators>.+?) ' r'and substitute with Representative'), r'CR; Do Pass(, as amended,|, amended by)? (?P<committees>.+)', r'coauthor (Senator|Representative) (?P<legislators>.+)', r'Ayes:\s+(?P<yes_votes>\d+)\s+Nays:\s+(?P<no_votes>\d+)' ]),
Rule( [ # Add a bajilion links to entities. r"SCs (changed|removed) (?P<legislators>.+)", r"Conference Committee on (?P<committees>.+)", r"Conference granted, naming:?\s+Conference Committee on (?P<committees>.+)", r"vote by Representative(?P<legislators>.+)", r"amended (?P<committees>.+?) committee", r"coauthored by (?P<legislators>.+)", ( r"Remove Senator .+? as principal Senate author " r"and substitute with Senator (?P<legislators>.+?)" ), r"(?i)committee substitute (?P<committees>.+)", r"(?i)remove\s{,10}as\s{,10}author\s{,10}(?P<legislators>.+);", r"(?i)SCs\s{,10}named\s{,10}(?P<legislators>.+)", ( r"Pending removal author Senator (?P<legislators>.+?) " r"and replace with Senator" ), r"(?i)Representative\(s\)\s{,10}(?P<legislators>.+)", r"Withdrawn from Calendar; (?P<committees>.+)", ( r"Pending removal author Senator .+? and replace " r"with Senator (?P<legislators>.+)" ), r"Ayes:\s+(?P<yes_votes>\d+)\s+Nays:\s+(?P<no_votes>\d+)", ( r"remove as principal author Representative .+? and substitute " r"with Representative (?P<legislators>.+?)" ), r"Pending coauthorship Senator\(s\) (?P<legislators>.+)", ( r"Remove Representative (?P<legislators>.+?) as principal " r"House author and substitute with Representative" ), r"Pending removal principal author Representative .+? and " r"replace with Representative (?P<legislators>.+)", r"(?i)(co)?authored\s{,10}by\s{,10}(?P<legislators>.+)", r"Second Reading referred to (?P<committees>.+? Committee)", r"Notice served to reconsider vote on measure (?P<legislators>.+)", ( r"Pending removal principal author Representative (?P<legislators>.+) " r"and replace with Representative .+" ), ( r"remove as principal author Representative (?P<legislators>.+?) " r"and substitute with Representative" ), r"CR; Do Pass(, as amended,|, amended by)? (?P<committees>.+)", r"coauthor (Senator|Representative) (?P<legislators>.+)", r"Ayes:\s+(?P<yes_votes>\d+)\s+Nays:\s+(?P<no_votes>\d+)", ] ),
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule(r"Amendment proposed on floor", "amendment-introduction"), Rule(r"Amendment failed", "amendment-failure"), Rule(r"Amendment adopted, placed on calendar", ""), Rule(r"^Filed with ", "introduction"), Rule(r"^Introduced", "introduction"), Rule(r"^Second reading", "reading-2"), Rule(r"passed as amended", "passage"), Rule(r"passed", "passage"), Rule(r"Sent to Governor", "executive-receipt"), Rule(r"Reported back", "committee-passage"), Rule(r"Reported back.*do pass", "committee-passage-favorable"), Rule(r"Reported back.*do not pass", "committee-passage-unfavorable"), Rule(r"^Signed by Governor", "executive-signature"), ) class NDCategorizer(BaseCategorizer): rules = _categorizer_rules
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule( ["Amendment #\\S+ \\((?P<legislator>.+?)\\) bundle YES adopted"], ["amendment-passage"], ), Rule(["(?i)Signed by (the )Governor(.*)"], ["executive-signature"]), Rule(["Accompanied (by )?(?P<bill_id>[SH]\\S+)"], []), Rule(["Discharged to the committee on (?P<committees>.+)"], ["referral-committee"]), Rule(["(?i)Amendment #\\d+ adopted"], ["amendment-passage"]), Rule( [ "Amendment #\\d+ \\((?P<legislator>.+?)\\) rejected", "(?i)amendment.+?rejected", ], ["amendment-failure"], ), Rule(["(?is)Amendment \\S+ withdrawn"], ["amendment-withdrawal"]), Rule( ["Amendment #\\S+ \\((?P<legislator>.+?)\\) Pending"], ["amendment-introduction"], ), Rule(["(?P<bill>[HS]\\d+)"], []), Rule(["(?i)Amendment \\(#\\d+\\) adopted"], ["amendment-passage"]), Rule(["(?i)with veto"], ["executive-veto"]), Rule(["reported favorably by committee"], ["committee-passage-favorable"]), Rule(["Accompan\\S+ .+?(?P<bill_id>[SH]\\S+)"], []), Rule(["(?i)Amendment \\d+ pending"], ["amendment-deferral"]), Rule(["Read,"], ["reading-1"]),
from openstates.utils.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( Rule((r"\(Ayes (?P<yes_votes>\d+)\.\s+Noes\s+" r"(?P<no_votes>\d+)\.( Page \S+\.)?\)")), Rule(r"^Introduced", "introduction"), Rule(r"(?i)Referred to (?P<committees>.+)", "referral-committee"), Rule(r"(?i)Referred to (?P<committees>.+?)(\.\s+suspense)", "referral-committee"), Rule(r"re-refer to Standing (?P<committees>[^.]+)\.", "referral-committee"), Rule(r"Read first time\.", "reading-1"), Rule(r"Read second time and amended", ["reading-2"]), Rule(r"Read third time", "reading-3"), Rule(r"Read third time. Refused passage\.", "failure"), Rule( [r"(?i)read third time.{,5}passed", r"(?i)Read third time.+?Passed"], ["passage", "reading-3"], ), Rule(r"Approved by the Governor", "executive-signature"), Rule(r"Approved by the Governor with item veto", "executive-veto-line-item"), Rule("Vetoed by Governor", "executive-veto"), Rule("Vetoed by the Governor", "executive-veto"), Rule(r"To Governor", "executive-receipt"), Rule(r"amendments concurred in", "amendment-passage"), Rule(r"refused to concur in Assembly amendments", "amendment-failure"), Rule(r"Failed passage in committee", "committee-failure"), Rule( r"From committee: Filed with the Chief Clerk pursuant to Joint Rule 56.",
u"Legislative Audit", u"Executive Committee of Legislative Council", u"Transportation", u"Health (?:and|&) Human Services", u"Education", u"Legislative Council", u"Legal Services", u"Capital Development", u"Transportation (?:and|&) Energy", u"Joint Budget Committee", u"Business, Labor, (?:and|&) Technology", u"State, Veterans, (?:and|&) Military Affairs", ] rules = ( Rule("^House", actor="lower"), Rule("^Senate", actor="upper"), Rule("^Introduced in Senate", actor="upper"), Rule("^Introduced in House", actor="lower"), Rule("^Governor", actor="executive"), Rule("Governor Action - Partial Veto", "executive-veto-line-item"), Rule("Sent to the Governor", "executive-receipt"), Rule("Governor Action - Signed", "executive-signature"), Rule("Governor Signed", "executive-signature"), Rule("Governor Action - Vetoed", "executive-veto"), Rule(r"^Introduced", "introduction"), Rule(r"Assigned to (?P<committees>.+)"), Rule("(?i)refer (un)?amended to (?P<committees>.+)", ["referral-committee"]), Rule(r"(?i)\S+ Committee on (?P<committees>.+?) Refer (un)amended"), Rule("Assigned to (<?P<committees>.+?)", "referral-committee"),
import re from openstates.utils.actions import Rule, BaseCategorizer rules = ( Rule([ (r"(?P<yes_votes>\d+) Yeas - (?P<no_votes>\d+) " r"Nays- (?P<excused>\d+) Excused - (?P<absent>\d+) Absent"), (r"(?P<yes_votes>\d+) -Yeas, (?P<no_votes>\d+) -Nays, " r"(?P<excused>\d+) -Excused, (?P<absent>\d+) -Absent"), r"(?P<committees>Committee on .+?) suggested and ordered printed", (r"\(Yeas (?P<yes_votes>\d+) - Nays (?P<no_votes>\d+) - Absent " r"(?P<absent>\d+) - Excused (?P<excused>\d+)\)( \(Vacancy " r"(?P<vacant>\d+)\))?"), ]), Rule([ r"Representative (?P<legislators>.+?) of \S+", r"Senator (?P<legislators>.+?of \S+)", r"Representative (?P<legislators>[A-Z]+?( of [A-Za-z]+))", r"Senator (?P<legislators>\S+ of \S+)", r"Representative [A-Z ]+? of \S+", ]), Rule( "REFERRED to the (?P<committees>Committee on [A-Z ]+(?![a-z]))", "referral-committee", ), Rule(["READ A SECOND TIME"], ["reading-2"]), Rule(["(?i)read once"], ["reading-1"]), Rule("(?i)finally passed", "passage"), Rule("(?i)passed to be enacted", "passage"), Rule(r"COMMITTED to the (?P<committees>Committee on .+?)\.", "referral-committee"),