# Path: roscraco/exception.py
# class RouterFetchError(RouterError):
#     pass


import sys
import base64
import contextlib
    import urllib.parse as urlencoder
    import urllib as urlencoder
    import urllib.request as requestor
    import urllib2 as requestor
from roscraco.exception import RouterFetchError

        Such requests sometimes use the POST request method,
        although not necessarily.
        """
        url = self.url_base + path
        self._invalidate_http_cache()
        return self._perform_http_request(url, *args, **kwargs)[2]

    def _handle_first_request(self):
        """To be implemented in a subclass
        (if it needs to do something special on the first request).
        """
        pass

    def _perform_http_request(self, url, data=None, headers=(), timeout=7.0):
        """Makes the actual HTTP request and returns the result.

        The result is a 3-tuple:
            - requested URL
            - info() - meta information, such as headers
            - contents
        """
        if self._is_first_request:
            self._is_first_request = False
            self._handle_first_request()

        if data is not None:
            if isinstance(data, dict) or isinstance(data, list):
                data = urlencoder.urlencode(data)
            else:

# Path: roscraco/exception.py
# class RouterFetchError(RouterError):
#     pass


# Path: roscraco/router/base.py
import sys
import base64
import contextlib
    import urllib.parse as urlencoder
    import urllib as urlencoder
    import urllib.request as requestor
    import urllib2 as requestor
from roscraco.exception import RouterFetchError


        Such requests sometimes use the POST request method,
        although not necessarily.
        """
        url = self.url_base + path
        self._invalidate_http_cache()
        return self._perform_http_request(url, *args, **kwargs)[2]

    def _handle_first_request(self):
        """To be implemented in a subclass
        (if it needs to do something special on the first request).
        """
        pass

    def _perform_http_request(self, url, data=None, headers=(), timeout=7.0):
        """Makes the actual HTTP request and returns the result.

        The result is a 3-tuple:
            - requested URL
            - info() - meta information, such as headers
            - contents
        """
        if self._is_first_request:
            self._is_first_request = False
            self._handle_first_request()

        if data is not None:
            if isinstance(data, dict) or isinstance(data, list):
                data = urlencoder.urlencode(data)
            else:

                raise RouterFetchError(