<commit_before>"""
Harvester of PubMed Central for the SHARE notification service

Example API call: http://www.pubmedcentral.nih.gov/oai/oai.cgi?verb=ListRecords&metadataPrefix=oai_dc&from=2015-04-13&until=2015-04-14
"""


from __future__ import unicode_literals

from scrapi.base import helpers
from scrapi.base import OAIHarvester


def format_uris_pubmedcentral(*args):
    identifiers = helpers.gather_identifiers(args)
    provider_uris, object_uris = helpers.seperate_provider_object_uris(identifiers)

    for arg in args:
        try:
            if 'oai:pubmedcentral.nih.gov:' in arg[0]:
                PMC_ID = arg[0].replace('oai:pubmedcentral.nih.gov:', '')
                canonical_uri = 'http://www.ncbi.nlm.nih.gov/pmc/articles/PMC' + PMC_ID
        except IndexError:
            pass

    if not canonical_uri:
        raise ValueError('No Canonical URI was returned for this record.')
<commit_msg>Gets rid of extra line<commit_after>"""
Harvester of PubMed Central for the SHARE notification service

Example API call: http://www.pubmedcentral.nih.gov/oai/oai.cgi?verb=ListRecords&metadataPrefix=oai_dc&from=2015-04-13&until=2015-04-14
"""

from __future__ import unicode_literals

from scrapi.base import helpers
from scrapi.base import OAIHarvester


def format_uris_pubmedcentral(*args):
    identifiers = helpers.gather_identifiers(args)
    provider_uris, object_uris = helpers.seperate_provider_object_uris(identifiers)

    for arg in args:
        try:
            if 'oai:pubmedcentral.nih.gov:' in arg[0]:
                PMC_ID = arg[0].replace('oai:pubmedcentral.nih.gov:', '')
                canonical_uri = 'http://www.ncbi.nlm.nih.gov/pmc/articles/PMC' + PMC_ID
        except IndexError:
            pass

    if not canonical_uri:
        raise ValueError('No Canonical URI was returned for this record.')

{'fraction_non_alphanumeric': 0.10075839653304441, 'fraction_numerical': 0.01950162513542795, 'mean_word_length': 3.483009708737864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5430807', 'n_tokens_mistral': 643, 'n_tokens_neox': 587, 'n_words': 128}