We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
KY failing since at least 2018-01-04
KY has been failing since 2018-01-04

Based on automated runs it appears that KY has not run successfully in 2 days (2018-01-04).


```
  00:00:39 CRITICAL pupa: Session(s) 2018 Regular Session were reported by Kentucky.get_session_list() but were not found in Kentucky.legislative_sessions or Kentucky.ignored_scraped_sessions.
no pupa_settings on path, using defaults
ky (scrape, import)
  people: {}
  bills: {}
```

Visit http://bobsled.openstates.org for more info.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `openstates/ky/__init__.py`
Content:
```
1 import re
2 
3 from pupa.scrape import Jurisdiction, Organization
4 
5 from openstates.utils import url_xpath
6 
7 from .people import KYPersonScraper
8 from .committees import KYCommitteeScraper
9 from .bills import KYBillScraper
10 
11 
12 class Kentucky(Jurisdiction):
13     division_id = "ocd-division/country:us/state:ky"
14     classification = "government"
15     name = "Kentucky"
16     url = "http://www.lrc.ky.gov/"
17     scrapers = {
18         'people': KYPersonScraper,
19         'committees': KYCommitteeScraper,
20         'bills': KYBillScraper,
21     }
22     parties = [
23         {'name': 'Republican'},
24         {'name': 'Democratic'}
25     ]
26     legislative_sessions = [
27         {
28             "_scraped_name": "2011 Regular Session",
29             "classification": "primary",
30             "end_date": "2011-03-09",
31             "identifier": "2011 Regular Session",
32             "name": "2011 Regular Session",
33             "start_date": "2011-01-04"
34         },
35         {
36             "_scraped_name": "2011 Extraordinary Session",
37             "classification": "special",
38             "end_date": "2011-04-06",
39             "identifier": "2011SS",
40             "name": "2011 Extraordinary Session",
41             "start_date": "2011-03-14"
42         },
43         {
44             "_scraped_name": "2012 Regular Session",
45             "classification": "primary",
46             "end_date": "2012-04-12",
47             "identifier": "2012RS",
48             "name": "2012 Regular Session",
49             "start_date": "2012-01-03"
50         },
51         {
52             "_scraped_name": "2012 Extraordinary Session",
53             "classification": "special",
54             "end_date": "2012-04-20",
55             "identifier": "2012SS",
56             "name": "2012 Extraordinary Session",
57             "start_date": "2012-04-16"
58         },
59         {
60             "_scraped_name": "2013 Regular Session",
61             "classification": "primary",
62             "end_date": "2013-03-26",
63             "identifier": "2013RS",
64             "name": "2013 Regular Session",
65             "start_date": "2013-01-08"
66         },
67         {
68             "_scraped_name": "2013 Extraordinary Session",
69             "classification": "special",
70             "end_date": "2013-08-19",
71             "identifier": "2013SS",
72             "name": "2013 Extraordinary Session",
73             "start_date": "2013-08-19"
74         },
75         {
76             "_scraped_name": "2014 Regular Session",
77             "classification": "primary",
78             "end_date": "2014-04-15",
79             "identifier": "2014RS",
80             "name": "2014 Regular Session",
81             "start_date": "2014-01-07"
82         },
83         {
84             "_scraped_name": "2015 Regular Session",
85             "classification": "primary",
86             "end_date": "2015-03-25",
87             "identifier": "2015RS",
88             "name": "2015 Regular Session",
89             "start_date": "2015-01-06"
90         },
91         {
92             "_scraped_name": "2016 Regular Session",
93             "classification": "primary",
94             "end_date": "2016-04-12",
95             "identifier": "2016RS",
96             "name": "2016 Regular Session",
97             "start_date": "2016-01-05"
98         },
99         {
100             "_scraped_name": "2017 Regular Session",
101             "classification": "primary",
102             "end_date": "2017-03-30",
103             "identifier": "2017RS",
104             "name": "2017 Regular Session",
105             "start_date": "2017-01-03"
106         }
107     ]
108     ignored_scraped_sessions = []
109 
110     def get_organizations(self):
111         legislature_name = "Kentucky General Assembly"
112         lower_chamber_name = "House"
113         lower_seats = 100
114         lower_title = "Representative"
115         upper_chamber_name = "Senate"
116         upper_seats = 38
117         upper_title = "Senator"
118 
119         legislature = Organization(name=legislature_name,
120                                    classification="legislature")
121         upper = Organization(upper_chamber_name, classification='upper',
122                              parent_id=legislature._id)
123         lower = Organization(lower_chamber_name, classification='lower',
124                              parent_id=legislature._id)
125 
126         for n in range(1, upper_seats + 1):
127             upper.add_post(
128                 label=str(n), role=upper_title,
129                 division_id='{}/sldu:{}'.format(self.division_id, n))
130         for n in range(1, lower_seats + 1):
131             lower.add_post(
132                 label=str(n), role=lower_title,
133                 division_id='{}/sldl:{}'.format(self.division_id, n))
134 
135         yield legislature
136         yield upper
137         yield lower
138 
139     def get_session_list(self):
140         sessions = url_xpath(
141             'http://www.lrc.ky.gov/legislation.htm',
142             '//a[contains(@href, "record.htm")]/text()[normalize-space()]')
143 
144         for index, session in enumerate(sessions):
145             # Remove escaped whitespace characters.
146             sessions[index] = re.sub(r'[\r\n\t]+', '', session)
147 
148         return sessions
149
```

Path: `billy_metadata/ky.py`
Content:
```
1 import datetime
2 
3 metadata = {
4     'name': 'Kentucky',
5     'abbreviation': 'ky',
6     'capitol_timezone': 'America/New_York',
7     'legislature_name': 'Kentucky General Assembly',
8     'legislature_url': 'http://www.lrc.ky.gov/',
9     'chambers': {
10         'upper': {'name': 'Senate', 'title': 'Senator'},
11         'lower': {'name': 'House', 'title': 'Representative'},
12     },
13     'terms': [
14         {
15             'name': '2011-2012',
16             'start_year': 2011,
17             'end_year': 2012,
18             'sessions': [
19                 '2011 Regular Session', '2011SS', '2012RS', '2012SS'
20             ]
21         },
22         {
23             'name': '2013-2014',
24             'start_year': 2013,
25             'end_year': 2014,
26             'sessions': [
27                 '2013RS', '2013SS', '2014RS',
28             ]
29         },
30         {
31             'name': '2015-2016',
32             'start_year': 2015,
33             'end_year': 2016,
34             'sessions': [
35                 '2015RS', '2016RS',
36             ]
37         },
38         {
39             'name': '2017-2018',
40             'start_year': 2017,
41             'end_year': 2018,
42             'sessions': [
43                 '2017RS',
44             ]
45         },
46     ],
47     'session_details': {
48         '2011 Regular Session': {
49             'type': 'primary',
50             'start_date': datetime.date(2011, 1, 4),
51             'end_date': datetime.date(2011, 3, 9),
52             'display_name': '2011 Regular Session',
53             '_scraped_name': '2011 Regular Session',
54         },
55         '2011SS': {
56             'type': 'special',
57             'start_date': datetime.date(2011, 3, 14),
58             'end_date': datetime.date(2011, 4, 6),
59             'display_name': '2011 Extraordinary Session',
60             '_scraped_name': '2011 Extraordinary Session',
61         },
62         '2012RS': {
63             'type': 'primary',
64             'start_date': datetime.date(2012, 1, 3),
65             'end_date': datetime.date(2012, 4, 12),
66             'display_name': '2012 Regular Session',
67             '_scraped_name': '2012 Regular Session',
68         },
69         '2012SS': {
70             'type': 'special',
71             'start_date': datetime.date(2012, 4, 16),
72             'end_date': datetime.date(2012, 4, 20),
73             'display_name': '2012 Extraordinary Session',
74             '_scraped_name': '2012 Extraordinary Session',
75         },
76         '2013RS': {
77             'type': 'primary',
78             'start_date': datetime.date(2013, 1, 8),
79             'end_date': datetime.date(2013, 3, 26),
80             'display_name': '2013 Regular Session',
81             '_scraped_name': '2013 Regular Session',
82         },
83         '2013SS': {
84             'type': 'special',
85             'start_date': datetime.date(2013, 8, 19),
86             'end_date': datetime.date(2013, 8, 19),
87             'display_name': '2013 Extraordinary Session',
88             '_scraped_name': '2013 Extraordinary Session',
89         },
90         '2014RS': {
91             'type': 'primary',
92             'start_date': datetime.date(2014, 1, 7),
93             'end_date': datetime.date(2014, 4, 15),
94             'display_name': '2014 Regular Session',
95             '_scraped_name': '2014 Regular Session',
96         },
97         '2015RS': {
98             'type': 'primary',
99             'start_date': datetime.date(2015, 1, 6),
100             'end_date': datetime.date(2015, 3, 25),
101             'display_name': '2015 Regular Session',
102             '_scraped_name': '2015 Regular Session',
103         },
104         '2016RS': {
105             'type': 'primary',
106             'start_date': datetime.date(2016, 1, 5),
107             'end_date': datetime.date(2016, 4, 12),
108             'display_name': '2016 Regular Session',
109             '_scraped_name': '2016 Regular Session',
110         },
111         '2017RS': {
112             'type': 'primary',
113             'start_date': datetime.date(2017, 1, 3),
114             'display_name': '2017 Regular Session',
115             '_scraped_name': '2017 Regular Session',
116         },
117     },
118     'feature_flags': ['subjects', 'events', 'influenceexplorer'],
119     '_ignored_scraped_sessions': [],
120 }
121
```
--- END FILES ---

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

Here is an example:

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

```

diff --git a/billy_metadata/ky.py b/billy_metadata/ky.py
--- a/billy_metadata/ky.py
+++ b/billy_metadata/ky.py
@@ -41,6 +41,7 @@
             'end_year': 2018,
             'sessions': [
                 '2017RS',
+                '2018RS',
             ]
         },
     ],
@@ -114,6 +115,12 @@
             'display_name': '2017 Regular Session',
             '_scraped_name': '2017 Regular Session',
         },
+        '2018RS': {
+            'type': 'primary',
+            'start_date': datetime.date(2018, 1, 2),
+            'display_name': '2018 Regular Session',
+            '_scraped_name': '2018 Regular Session',
+        },
     },
     'feature_flags': ['subjects', 'events', 'influenceexplorer'],
     '_ignored_scraped_sessions': [],
diff --git a/openstates/ky/__init__.py b/openstates/ky/__init__.py
--- a/openstates/ky/__init__.py
+++ b/openstates/ky/__init__.py
@@ -103,7 +103,15 @@
             "identifier": "2017RS",
             "name": "2017 Regular Session",
             "start_date": "2017-01-03"
-        }
+        },
+        {
+            "_scraped_name": "2018 Regular Session",
+            "classification": "primary",
+            "end_date": "2018-04-13",
+            "identifier": "2018RS",
+            "name": "2018 Regular Session",
+            "start_date": "2018-01-02"
+        },
     ]
     ignored_scraped_sessions = []

{"golden_diff": "diff --git a/billy_metadata/ky.py b/billy_metadata/ky.py\n--- a/billy_metadata/ky.py\n+++ b/billy_metadata/ky.py\n@@ -41,6 +41,7 @@\n             'end_year': 2018,\n             'sessions': [\n                 '2017RS',\n+                '2018RS',\n             ]\n         },\n     ],\n@@ -114,6 +115,12 @@\n             'display_name': '2017 Regular Session',\n             '_scraped_name': '2017 Regular Session',\n         },\n+        '2018RS': {\n+            'type': 'primary',\n+            'start_date': datetime.date(2018, 1, 2),\n+            'display_name': '2018 Regular Session',\n+            '_scraped_name': '2018 Regular Session',\n+        },\n     },\n     'feature_flags': ['subjects', 'events', 'influenceexplorer'],\n     '_ignored_scraped_sessions': [],\ndiff --git a/openstates/ky/__init__.py b/openstates/ky/__init__.py\n--- a/openstates/ky/__init__.py\n+++ b/openstates/ky/__init__.py\n@@ -103,7 +103,15 @@\n             \"identifier\": \"2017RS\",\n             \"name\": \"2017 Regular Session\",\n             \"start_date\": \"2017-01-03\"\n-        }\n+        },\n+        {\n+            \"_scraped_name\": \"2018 Regular Session\",\n+            \"classification\": \"primary\",\n+            \"end_date\": \"2018-04-13\",\n+            \"identifier\": \"2018RS\",\n+            \"name\": \"2018 Regular Session\",\n+            \"start_date\": \"2018-01-02\"\n+        },\n     ]\n     ignored_scraped_sessions = []\n", "issue": "KY failing since at least 2018-01-04\nKY has been failing since 2018-01-04\n\nBased on automated runs it appears that KY has not run successfully in 2 days (2018-01-04).\n\n\n```\n  00:00:39 CRITICAL pupa: Session(s) 2018 Regular Session were reported by Kentucky.get_session_list() but were not found in Kentucky.legislative_sessions or Kentucky.ignored_scraped_sessions.\nno pupa_settings on path, using defaults\nky (scrape, import)\n  people: {}\n  bills: {}\n```\n\nVisit http://bobsled.openstates.org for more info.\n\n", "before_files": [{"content": "import re\n\nfrom pupa.scrape import Jurisdiction, Organization\n\nfrom openstates.utils import url_xpath\n\nfrom .people import KYPersonScraper\nfrom .committees import KYCommitteeScraper\nfrom .bills import KYBillScraper\n\n\nclass Kentucky(Jurisdiction):\n    division_id = \"ocd-division/country:us/state:ky\"\n    classification = \"government\"\n    name = \"Kentucky\"\n    url = \"http://www.lrc.ky.gov/\"\n    scrapers = {\n        'people': KYPersonScraper,\n        'committees': KYCommitteeScraper,\n        'bills': KYBillScraper,\n    }\n    parties = [\n        {'name': 'Republican'},\n        {'name': 'Democratic'}\n    ]\n    legislative_sessions = [\n        {\n            \"_scraped_name\": \"2011 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2011-03-09\",\n            \"identifier\": \"2011 Regular Session\",\n            \"name\": \"2011 Regular Session\",\n            \"start_date\": \"2011-01-04\"\n        },\n        {\n            \"_scraped_name\": \"2011 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2011-04-06\",\n            \"identifier\": \"2011SS\",\n            \"name\": \"2011 Extraordinary Session\",\n            \"start_date\": \"2011-03-14\"\n        },\n        {\n            \"_scraped_name\": \"2012 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2012-04-12\",\n            \"identifier\": \"2012RS\",\n            \"name\": \"2012 Regular Session\",\n            \"start_date\": \"2012-01-03\"\n        },\n        {\n            \"_scraped_name\": \"2012 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2012-04-20\",\n            \"identifier\": \"2012SS\",\n            \"name\": \"2012 Extraordinary Session\",\n            \"start_date\": \"2012-04-16\"\n        },\n        {\n            \"_scraped_name\": \"2013 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2013-03-26\",\n            \"identifier\": \"2013RS\",\n            \"name\": \"2013 Regular Session\",\n            \"start_date\": \"2013-01-08\"\n        },\n        {\n            \"_scraped_name\": \"2013 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2013-08-19\",\n            \"identifier\": \"2013SS\",\n            \"name\": \"2013 Extraordinary Session\",\n            \"start_date\": \"2013-08-19\"\n        },\n        {\n            \"_scraped_name\": \"2014 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2014-04-15\",\n            \"identifier\": \"2014RS\",\n            \"name\": \"2014 Regular Session\",\n            \"start_date\": \"2014-01-07\"\n        },\n        {\n            \"_scraped_name\": \"2015 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2015-03-25\",\n            \"identifier\": \"2015RS\",\n            \"name\": \"2015 Regular Session\",\n            \"start_date\": \"2015-01-06\"\n        },\n        {\n            \"_scraped_name\": \"2016 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2016-04-12\",\n            \"identifier\": \"2016RS\",\n            \"name\": \"2016 Regular Session\",\n            \"start_date\": \"2016-01-05\"\n        },\n        {\n            \"_scraped_name\": \"2017 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2017-03-30\",\n            \"identifier\": \"2017RS\",\n            \"name\": \"2017 Regular Session\",\n            \"start_date\": \"2017-01-03\"\n        }\n    ]\n    ignored_scraped_sessions = []\n\n    def get_organizations(self):\n        legislature_name = \"Kentucky General Assembly\"\n        lower_chamber_name = \"House\"\n        lower_seats = 100\n        lower_title = \"Representative\"\n        upper_chamber_name = \"Senate\"\n        upper_seats = 38\n        upper_title = \"Senator\"\n\n        legislature = Organization(name=legislature_name,\n                                   classification=\"legislature\")\n        upper = Organization(upper_chamber_name, classification='upper',\n                             parent_id=legislature._id)\n        lower = Organization(lower_chamber_name, classification='lower',\n                             parent_id=legislature._id)\n\n        for n in range(1, upper_seats + 1):\n            upper.add_post(\n                label=str(n), role=upper_title,\n                division_id='{}/sldu:{}'.format(self.division_id, n))\n        for n in range(1, lower_seats + 1):\n            lower.add_post(\n                label=str(n), role=lower_title,\n                division_id='{}/sldl:{}'.format(self.division_id, n))\n\n        yield legislature\n        yield upper\n        yield lower\n\n    def get_session_list(self):\n        sessions = url_xpath(\n            'http://www.lrc.ky.gov/legislation.htm',\n            '//a[contains(@href, \"record.htm\")]/text()[normalize-space()]')\n\n        for index, session in enumerate(sessions):\n            # Remove escaped whitespace characters.\n            sessions[index] = re.sub(r'[\\r\\n\\t]+', '', session)\n\n        return sessions\n", "path": "openstates/ky/__init__.py"}, {"content": "import datetime\n\nmetadata = {\n    'name': 'Kentucky',\n    'abbreviation': 'ky',\n    'capitol_timezone': 'America/New_York',\n    'legislature_name': 'Kentucky General Assembly',\n    'legislature_url': 'http://www.lrc.ky.gov/',\n    'chambers': {\n        'upper': {'name': 'Senate', 'title': 'Senator'},\n        'lower': {'name': 'House', 'title': 'Representative'},\n    },\n    'terms': [\n        {\n            'name': '2011-2012',\n            'start_year': 2011,\n            'end_year': 2012,\n            'sessions': [\n                '2011 Regular Session', '2011SS', '2012RS', '2012SS'\n            ]\n        },\n        {\n            'name': '2013-2014',\n            'start_year': 2013,\n            'end_year': 2014,\n            'sessions': [\n                '2013RS', '2013SS', '2014RS',\n            ]\n        },\n        {\n            'name': '2015-2016',\n            'start_year': 2015,\n            'end_year': 2016,\n            'sessions': [\n                '2015RS', '2016RS',\n            ]\n        },\n        {\n            'name': '2017-2018',\n            'start_year': 2017,\n            'end_year': 2018,\n            'sessions': [\n                '2017RS',\n            ]\n        },\n    ],\n    'session_details': {\n        '2011 Regular Session': {\n            'type': 'primary',\n            'start_date': datetime.date(2011, 1, 4),\n            'end_date': datetime.date(2011, 3, 9),\n            'display_name': '2011 Regular Session',\n            '_scraped_name': '2011 Regular Session',\n        },\n        '2011SS': {\n            'type': 'special',\n            'start_date': datetime.date(2011, 3, 14),\n            'end_date': datetime.date(2011, 4, 6),\n            'display_name': '2011 Extraordinary Session',\n            '_scraped_name': '2011 Extraordinary Session',\n        },\n        '2012RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2012, 1, 3),\n            'end_date': datetime.date(2012, 4, 12),\n            'display_name': '2012 Regular Session',\n            '_scraped_name': '2012 Regular Session',\n        },\n        '2012SS': {\n            'type': 'special',\n            'start_date': datetime.date(2012, 4, 16),\n            'end_date': datetime.date(2012, 4, 20),\n            'display_name': '2012 Extraordinary Session',\n            '_scraped_name': '2012 Extraordinary Session',\n        },\n        '2013RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2013, 1, 8),\n            'end_date': datetime.date(2013, 3, 26),\n            'display_name': '2013 Regular Session',\n            '_scraped_name': '2013 Regular Session',\n        },\n        '2013SS': {\n            'type': 'special',\n            'start_date': datetime.date(2013, 8, 19),\n            'end_date': datetime.date(2013, 8, 19),\n            'display_name': '2013 Extraordinary Session',\n            '_scraped_name': '2013 Extraordinary Session',\n        },\n        '2014RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2014, 1, 7),\n            'end_date': datetime.date(2014, 4, 15),\n            'display_name': '2014 Regular Session',\n            '_scraped_name': '2014 Regular Session',\n        },\n        '2015RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2015, 1, 6),\n            'end_date': datetime.date(2015, 3, 25),\n            'display_name': '2015 Regular Session',\n            '_scraped_name': '2015 Regular Session',\n        },\n        '2016RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2016, 1, 5),\n            'end_date': datetime.date(2016, 4, 12),\n            'display_name': '2016 Regular Session',\n            '_scraped_name': '2016 Regular Session',\n        },\n        '2017RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2017, 1, 3),\n            'display_name': '2017 Regular Session',\n            '_scraped_name': '2017 Regular Session',\n        },\n    },\n    'feature_flags': ['subjects', 'events', 'influenceexplorer'],\n    '_ignored_scraped_sessions': [],\n}\n", "path": "billy_metadata/ky.py"}], "after_files": [{"content": "import re\n\nfrom pupa.scrape import Jurisdiction, Organization\n\nfrom openstates.utils import url_xpath\n\nfrom .people import KYPersonScraper\nfrom .committees import KYCommitteeScraper\nfrom .bills import KYBillScraper\n\n\nclass Kentucky(Jurisdiction):\n    division_id = \"ocd-division/country:us/state:ky\"\n    classification = \"government\"\n    name = \"Kentucky\"\n    url = \"http://www.lrc.ky.gov/\"\n    scrapers = {\n        'people': KYPersonScraper,\n        'committees': KYCommitteeScraper,\n        'bills': KYBillScraper,\n    }\n    parties = [\n        {'name': 'Republican'},\n        {'name': 'Democratic'}\n    ]\n    legislative_sessions = [\n        {\n            \"_scraped_name\": \"2011 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2011-03-09\",\n            \"identifier\": \"2011 Regular Session\",\n            \"name\": \"2011 Regular Session\",\n            \"start_date\": \"2011-01-04\"\n        },\n        {\n            \"_scraped_name\": \"2011 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2011-04-06\",\n            \"identifier\": \"2011SS\",\n            \"name\": \"2011 Extraordinary Session\",\n            \"start_date\": \"2011-03-14\"\n        },\n        {\n            \"_scraped_name\": \"2012 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2012-04-12\",\n            \"identifier\": \"2012RS\",\n            \"name\": \"2012 Regular Session\",\n            \"start_date\": \"2012-01-03\"\n        },\n        {\n            \"_scraped_name\": \"2012 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2012-04-20\",\n            \"identifier\": \"2012SS\",\n            \"name\": \"2012 Extraordinary Session\",\n            \"start_date\": \"2012-04-16\"\n        },\n        {\n            \"_scraped_name\": \"2013 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2013-03-26\",\n            \"identifier\": \"2013RS\",\n            \"name\": \"2013 Regular Session\",\n            \"start_date\": \"2013-01-08\"\n        },\n        {\n            \"_scraped_name\": \"2013 Extraordinary Session\",\n            \"classification\": \"special\",\n            \"end_date\": \"2013-08-19\",\n            \"identifier\": \"2013SS\",\n            \"name\": \"2013 Extraordinary Session\",\n            \"start_date\": \"2013-08-19\"\n        },\n        {\n            \"_scraped_name\": \"2014 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2014-04-15\",\n            \"identifier\": \"2014RS\",\n            \"name\": \"2014 Regular Session\",\n            \"start_date\": \"2014-01-07\"\n        },\n        {\n            \"_scraped_name\": \"2015 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2015-03-25\",\n            \"identifier\": \"2015RS\",\n            \"name\": \"2015 Regular Session\",\n            \"start_date\": \"2015-01-06\"\n        },\n        {\n            \"_scraped_name\": \"2016 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2016-04-12\",\n            \"identifier\": \"2016RS\",\n            \"name\": \"2016 Regular Session\",\n            \"start_date\": \"2016-01-05\"\n        },\n        {\n            \"_scraped_name\": \"2017 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2017-03-30\",\n            \"identifier\": \"2017RS\",\n            \"name\": \"2017 Regular Session\",\n            \"start_date\": \"2017-01-03\"\n        },\n        {\n            \"_scraped_name\": \"2018 Regular Session\",\n            \"classification\": \"primary\",\n            \"end_date\": \"2018-04-13\",\n            \"identifier\": \"2018RS\",\n            \"name\": \"2018 Regular Session\",\n            \"start_date\": \"2018-01-02\"\n        },\n    ]\n    ignored_scraped_sessions = []\n\n    def get_organizations(self):\n        legislature_name = \"Kentucky General Assembly\"\n        lower_chamber_name = \"House\"\n        lower_seats = 100\n        lower_title = \"Representative\"\n        upper_chamber_name = \"Senate\"\n        upper_seats = 38\n        upper_title = \"Senator\"\n\n        legislature = Organization(name=legislature_name,\n                                   classification=\"legislature\")\n        upper = Organization(upper_chamber_name, classification='upper',\n                             parent_id=legislature._id)\n        lower = Organization(lower_chamber_name, classification='lower',\n                             parent_id=legislature._id)\n\n        for n in range(1, upper_seats + 1):\n            upper.add_post(\n                label=str(n), role=upper_title,\n                division_id='{}/sldu:{}'.format(self.division_id, n))\n        for n in range(1, lower_seats + 1):\n            lower.add_post(\n                label=str(n), role=lower_title,\n                division_id='{}/sldl:{}'.format(self.division_id, n))\n\n        yield legislature\n        yield upper\n        yield lower\n\n    def get_session_list(self):\n        sessions = url_xpath(\n            'http://www.lrc.ky.gov/legislation.htm',\n            '//a[contains(@href, \"record.htm\")]/text()[normalize-space()]')\n\n        for index, session in enumerate(sessions):\n            # Remove escaped whitespace characters.\n            sessions[index] = re.sub(r'[\\r\\n\\t]+', '', session)\n\n        return sessions\n", "path": "openstates/ky/__init__.py"}, {"content": "import datetime\n\nmetadata = {\n    'name': 'Kentucky',\n    'abbreviation': 'ky',\n    'capitol_timezone': 'America/New_York',\n    'legislature_name': 'Kentucky General Assembly',\n    'legislature_url': 'http://www.lrc.ky.gov/',\n    'chambers': {\n        'upper': {'name': 'Senate', 'title': 'Senator'},\n        'lower': {'name': 'House', 'title': 'Representative'},\n    },\n    'terms': [\n        {\n            'name': '2011-2012',\n            'start_year': 2011,\n            'end_year': 2012,\n            'sessions': [\n                '2011 Regular Session', '2011SS', '2012RS', '2012SS'\n            ]\n        },\n        {\n            'name': '2013-2014',\n            'start_year': 2013,\n            'end_year': 2014,\n            'sessions': [\n                '2013RS', '2013SS', '2014RS',\n            ]\n        },\n        {\n            'name': '2015-2016',\n            'start_year': 2015,\n            'end_year': 2016,\n            'sessions': [\n                '2015RS', '2016RS',\n            ]\n        },\n        {\n            'name': '2017-2018',\n            'start_year': 2017,\n            'end_year': 2018,\n            'sessions': [\n                '2017RS',\n                '2018RS',\n            ]\n        },\n    ],\n    'session_details': {\n        '2011 Regular Session': {\n            'type': 'primary',\n            'start_date': datetime.date(2011, 1, 4),\n            'end_date': datetime.date(2011, 3, 9),\n            'display_name': '2011 Regular Session',\n            '_scraped_name': '2011 Regular Session',\n        },\n        '2011SS': {\n            'type': 'special',\n            'start_date': datetime.date(2011, 3, 14),\n            'end_date': datetime.date(2011, 4, 6),\n            'display_name': '2011 Extraordinary Session',\n            '_scraped_name': '2011 Extraordinary Session',\n        },\n        '2012RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2012, 1, 3),\n            'end_date': datetime.date(2012, 4, 12),\n            'display_name': '2012 Regular Session',\n            '_scraped_name': '2012 Regular Session',\n        },\n        '2012SS': {\n            'type': 'special',\n            'start_date': datetime.date(2012, 4, 16),\n            'end_date': datetime.date(2012, 4, 20),\n            'display_name': '2012 Extraordinary Session',\n            '_scraped_name': '2012 Extraordinary Session',\n        },\n        '2013RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2013, 1, 8),\n            'end_date': datetime.date(2013, 3, 26),\n            'display_name': '2013 Regular Session',\n            '_scraped_name': '2013 Regular Session',\n        },\n        '2013SS': {\n            'type': 'special',\n            'start_date': datetime.date(2013, 8, 19),\n            'end_date': datetime.date(2013, 8, 19),\n            'display_name': '2013 Extraordinary Session',\n            '_scraped_name': '2013 Extraordinary Session',\n        },\n        '2014RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2014, 1, 7),\n            'end_date': datetime.date(2014, 4, 15),\n            'display_name': '2014 Regular Session',\n            '_scraped_name': '2014 Regular Session',\n        },\n        '2015RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2015, 1, 6),\n            'end_date': datetime.date(2015, 3, 25),\n            'display_name': '2015 Regular Session',\n            '_scraped_name': '2015 Regular Session',\n        },\n        '2016RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2016, 1, 5),\n            'end_date': datetime.date(2016, 4, 12),\n            'display_name': '2016 Regular Session',\n            '_scraped_name': '2016 Regular Session',\n        },\n        '2017RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2017, 1, 3),\n            'display_name': '2017 Regular Session',\n            '_scraped_name': '2017 Regular Session',\n        },\n        '2018RS': {\n            'type': 'primary',\n            'start_date': datetime.date(2018, 1, 2),\n            'display_name': '2018 Regular Session',\n            '_scraped_name': '2018 Regular Session',\n        },\n    },\n    'feature_flags': ['subjects', 'events', 'influenceexplorer'],\n    '_ignored_scraped_sessions': [],\n}\n", "path": "billy_metadata/ky.py"}]}