def repository(**kwargs):
    if 'url' not in kwargs:
        kwargs['url'] = 'https://github.com/example-{0}/example.git'.format(
            random.randint(1, 100000))

    try:
        result = Repository.query.filter_by(url=kwargs['url'])[0]
    except __HOLE__:
        result = Repository(**kwargs)
        db.session.add(result)
    return result
dataset/ETHPy150Open dropbox/changes/changes/mock.py/repository