def clean_pmid(input_pmid):
    try:
        pmid = remove_nonprinting_characters(input_pmid)
        pmid = pmid.lower().replace("pmid:", "")
        match = re.match("^(\d{3,15})$", pmid)
        if match:
            pmid = match.group(1)
        else:
            pmid = None

    except __HOLE__:
        pmid = None

    if not pmid:
        logger.debug(u"MALFORMED PMID {input_pmid}".format(
            input_pmid=input_pmid))

    return pmid
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpact/providers/pubmed.py/clean_pmid