def get_pdf(article, debug=False):
    """
    Download an article PDF from arXiv.

    :param article:
        The ADS article to retrieve.

    :type article:
        :class:`ads.search.Article`

    :returns:
        The binary content of the requested PDF.
    """

    print('Retrieving {0}'.format(article))

    identifier = [_ for _ in article.identifier if _ in 'arXiv']
    if identifier:
        url = 'http://arXiv.org/pdf/{0}.{1}'.format(identifier[0][9:13],
            ''.join(_ for _ in identifier[0][14:] if _.isdigit()))
    else:
        # No arXiv version. Ask ADS to redirect us to the journal article.
        params = {
            'bibcode': article.bibcode,
            'link_type': 'ARTICLE',
            'db_key': 'AST'
        }
        url = requests.get('http://adsabs.harvard.edu/cgi-bin/nph-data_query', 
            params=params).url

    q = requests.get(url)
    if not q.ok:
        print('Error retrieving {0}: {1} for {2}'.format(
            article, q.status_code, url))
        if debug: q.raise_for_status()
        else: return None

    # Check if the journal has given back forbidden HTML.
    if q.content.endswith('</html>'):
        print('Error retrieving {0}: 200 (access denied?) for {1}'.format(
            article, url))
        return None
    return q.content
dataset/ETHPy150Open andycasey/ads/examples/monthly-institute-publications/stromlo.py/get_pdf/swapped operands of `in`