def get_runs_by_key_value(key, value, session=None):
    session = session or get_session()
    query = db_utils.model_query(models.Run, session=session).join(
        models.RunMetadata,
        models.Run.id == models.RunMetadata.run_id).filter_by(
            key=key, value=value)

    return query.all()
Check if user requested a permission for the given object
dataset/ETHPy150Open openstack-infra/subunit2sql/subunit2sql/db/api.py/get_runs_by_key_value--crossover with--dataset/ETHPy150Open jazzband/django-authority/authority/permissions.py/BasePermission.requested_perm