def get_url(url, fname, target_dir='galaxy/raw/'):
    outfile = os.path.join(target_dir + fname)
    if os.path.exists(outfile) and (os.path.getsize(outfile) > 0):
        return

    print '+%s' % (url + fname)
    data = urlopen(url + fname)

    if data.getcode() != 200:
        print '%s returned status code %i' % (url + fname, data.getcode())
        return

    t0 = time()
    with open(outfile, 'wb') as out:
        out.write(data.read())
    t1 = time()
    print 'Downloaded in %i seconds' % (t1 - t0)
Add ticket to database.
dataset/ETHPy150Open ChrisBeaumont/brut/bubbly/data/scrape.py/get_url--crossover with--dataset/ETHPy150Open edgewall/trac/trac/ticket/model.py/Ticket.insert