<s> """<STR_LIT>""" <EOL> import sys <EOL> import requests <EOL> import hashlib <EOL> import random <EOL> from common import importBibTeXIntoBibDesk <EOL> data = sys . argv [ <NUM_LIT:1> ] . split ( '<STR_LIT>' ) <EOL> bibtex_link = data [ <NUM_LIT:0> ] <EOL> pdf_link = data [ <NUM_LIT:1> ] <EOL> if pdf_link == '<STR_LIT:None>' : <EOL> pdf_link = None <EOL> google_id = hashlib . md5 ( str ( random . random ( ) ) ) . hexdigest ( ) [ : <NUM_LIT:16> ] <EOL> headers = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' % google_id } <EOL> r = requests . get ( bibtex_link , headers = headers ) <EOL> bibtex = r . text <EOL> importBibTeXIntoBibDesk ( bibtex , pdf_link ) </s>
