def aliases(self, 
            aliases, 
            provider_url_template=None,
            cache_enabled=True):            

        new_aliases = []

        for alias in aliases:
            (namespace, nid) = alias
            if (namespace == "doi"):
                aliases_from_doi_url = self.aliases_from_doi_url_template %nid
                page = self._get_eutils_page(aliases_from_doi_url, nid, cache_enabled)
                if page:
                    new_aliases += self._extract_aliases_from_doi(page, nid)
            if (namespace == "pmid"):
                # look up doi and other things on pubmed page
                aliases_from_pmid_url = self.aliases_from_pmid_url_template %nid
                page = self._get_eutils_page(aliases_from_pmid_url, nid, cache_enabled)
                if page:
                    new_aliases += self._extract_aliases_from_pmid(page, nid)
                    biblio = self._extract_biblio_efetch(page, nid)
                    if biblio:
                        new_aliases += [("biblio", biblio)]
                # also, add link to paper on pubmed
                new_aliases += [("url", self.aliases_pubmed_url_template %nid)] 
                if not "doi" in [namespace for (namespace, temp_nid) in new_aliases]:
                    aliases_doi_from_pmid_url = self.aliases_doi_from_pmid_url_template %nid
                    try:
                        response = self.http_get(aliases_doi_from_pmid_url, cache_enabled=cache_enabled)
                        if response.status_code==200 and ("doi" in response.text):
                            doi = json.loads(response.text)["records"][0]["doi"]
                            new_aliases += [("doi", doi)]
                    except (KeyError, __HOLE__):
                        pass
                    except ProviderHttpError as e:
                        logger.warning(u"ProviderHttpError when calling {url}".format(
                            url=aliases_doi_from_pmid_url))
                        # just keep going for now.  eventually will need to replace the call w somehting that works.
                        pass


        # get uniques for things that are unhashable
        new_aliases_unique = [k for k,v in itertools.groupby(sorted(new_aliases))]

        return new_aliases_unique
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpact/providers/pubmed.py/Pubmed.aliases