# Path: openelex/base/state.py
# class StateBase(object):
#     """Base class with common functionality for working with state modules.
# 
#     Intended to be subclassed by other base modules or
#     state specific modules
#     """
# 
#     def __init__(self, state=''):
#         if not state:
#             self.state = self.__module__.split('.')[-2]
#         else:
#             self.state = state
#         self.cache = StateCache(self.state)
#         # Create mappings directory if it doesn't exist
#         self.mappings_dir = os.path.join(PROJECT_ROOT, 'us', self.state, 'mappings')
#         try:
#             os.makedirs(self.mappings_dir)
#         except OSError:
#             pass
#         # Create ocd mappings csv if it doesn't exist
#         open(os.path.join(self.mappings_dir, self.state + '.csv'), 'a').close()


from future import standard_library
from os.path import exists, join
from .state import StateBase
import urllib.request, urllib.parse, urllib.error
import urllib.parse
from __future__ import print_function
standard_library.install_aliases()


class HTTPError(Exception):

# Path: openelex/base/state.py
# class StateBase(object):
#     """Base class with common functionality for working with state modules.
# 
#     Intended to be subclassed by other base modules or
#     state specific modules
#     """
# 
#     def __init__(self, state=''):
#         if not state:
#             self.state = self.__module__.split('.')[-2]
#         else:
#             self.state = state
#         self.cache = StateCache(self.state)
#         # Create mappings directory if it doesn't exist
#         self.mappings_dir = os.path.join(PROJECT_ROOT, 'us', self.state, 'mappings')
#         try:
#             os.makedirs(self.mappings_dir)
#         except OSError:
#             pass
#         # Create ocd mappings csv if it doesn't exist
#         open(os.path.join(self.mappings_dir, self.state + '.csv'), 'a').close()


# Path: openelex/base/fetch.py
from future import standard_library
from os.path import exists, join
from .state import StateBase
import urllib.request, urllib.parse, urllib.error
import urllib.parse

from __future__ import print_function
standard_library.install_aliases()


class HTTPError(Exception):

    def __init__(self, code, reason):