def _get_templated_url(self, template, id, method=None):
        try:
            id_unicode = unicode(id, "UTF-8")
        except __HOLE__:
            id_unicode = id
        id_utf8 = id_unicode.encode("UTF-8")

        substitute_id = id_utf8
        if template != "%s":
           substitute_id = urllib.quote(id_utf8)

        url = template % substitute_id
        return(url)
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpact/providers/provider.py/Provider._get_templated_url