@classmethod
    def _fetch_remote(cls, uri, depth_indicator=1):
        """
        return remote document and actual remote uri
        :type uri: str
        :type depth_indicator: int
        :rtype: (document: str | None, uri)
        """

        cls._log("debug", "fetch remote(%d): %s" % (depth_indicator, uri))
        request = Request(uri, headers=cls.request_headers())
        response = urlopen(request, timeout=cls.request_timeout())

        if not response:
            return None

        uri = response.geturl()

        charset = 'utf8'
        try:
            charset = response.info().get_param('charset', charset)     # py3
        except __HOLE__:
            pass

        return response.read().decode(charset), uri
dataset/ETHPy150Open k4cg/nichtparasoup/crawler/__init__.py/Crawler._fetch_remote