def get_random_dryad_dois(year, sample_size, email, query, seed=None):
    if 2009 < year:
        return []

    url = "http://datadryad.org/solr/search/select/?q=location:l2+dc.date.available_dt:[{year}-01-01T00:00:00Z%20TO%20{year}-12-31T23:59:59Z]&fl=dc.identifier&rows=1000000".format(year=year)
    print url
    try:
        r = requests.get(url, timeout=10)
    except requests.Timeout:
        print "dryad isn't working right now (timed out); sending back an empty list."
        return []
    # sick of parsing xml to get simple things.  I'm using regex this time, darn it.
    all_dois = re.findall("<str>doi:(10.5061/dryad.[a-z0-9]+)</str>", r.text)
    print all_dois[1]
    print len(all_dois)

    if seed:
        random.seed(seed)
    random_dois = random.sample(all_dois, sample_size)
    return random_dois
dataset/ETHPy150Open Impactstory/total-impact-core/extras/build_refsets/get_refsets.py/get_random_dryad_dois/swapped operands of `<`