def open(self, url):
        try:
            content, headers_dict = self.url_mappings[url]
        except __HOLE__:
            raise IOError # simulate a connection error
        if callable(content):
            content = content()
        if not hasattr(content, 'read'):
            f = StringIO(content)
        headers = self.headers
        if not headers_dict and headers_dict != {}:
            headers_dict = {}
        headers.update(headers_dict)
        return MockResponseWrapper(url, f, headers)

# Mock sources
dataset/ETHPy150Open ofri/Open-Knesset/mks/mock.py/MockReader.open