def _extract_metrics(self, page, status_code=200, id=None): 
        if status_code != 200:
            if status_code == 404:
                return {}
            else:
                raise(self._get_error(status_code))

        if page not in "<pmc-web-stat>":
            raise ProviderContentMalformedError

        (doc, lookup_function) = provider._get_doc_from_xml(page)
        if not doc:
            return {}
        try:
            articles = doc.getElementsByTagName("article")
            for article in articles:
                print article
                metrics_dict = {}            
                meta_data = article.getElementsByTagName("meta-data")[0]
                pmid = meta_data.getAttribute("pubmed-id")
                if id == pmid:
                    metrics = article.getElementsByTagName("usage")[0]
                    
                    pdf_downloads = int(metrics.getAttribute("pdf"))
                    if pdf_downloads:
                        metrics_dict.update({'pmc:pdf_downloads': pdf_downloads})

                    abstract_views = int(metrics.getAttribute("abstract"))
                    if abstract_views:
                        metrics_dict.update({'pmc:abstract_views': abstract_views})

                    fulltext_views = int(metrics.getAttribute("full-text"))
                    if fulltext_views:
                        metrics_dict.update({'pmc:fulltext_views': fulltext_views})

                    unique_ip_views = int(metrics.getAttribute("unique-ip"))
                    if unique_ip_views:
                        metrics_dict.update({'pmc:unique_ip_views': unique_ip_views})

                    figure_views = int(metrics.getAttribute("figure"))
                    if figure_views:
                        metrics_dict.update({'pmc:figure_views': figure_views})

                    suppdata_views = int(metrics.getAttribute("supp-data"))
                    if suppdata_views:
                        metrics_dict.update({'pmc:suppdata_views': suppdata_views})

                    return metrics_dict

        except (KeyError, IndexError, TypeError):
            pass

        return {}
dataset/ETHPy150Open Impactstory/total-impact-core/totalimpact/providers/pmc.py/Pmc._extract_metrics/swapped operands of `not in`