<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_scenario(scenario_id,**kwargs):
 """ Get the specified scenario """


    user_id = kwargs.get('user_id')

    scen_i = _get_scenario(scenario_id, user_id)

    scen_j = JSONObject(scen_i)
    rscen_rs = db.DBSession.query(ResourceScenario).filter(ResourceScenario.scenario_id==scenario_id).options(joinedload_all('dataset.metadata')).all()

    #lazy load resource attributes and attributes
    for rs in rscen_rs:
        rs.resourceattr
        rs.resourceattr.attr

    rgi_rs = db.DBSession.query(ResourceGroupItem).filter(ResourceGroupItem.scenario_id==scenario_id).all()

    scen_j.resourcescenarios = []
    for rs in rscen_rs:
        rs_j = JSONObject(rs, extras={'resourceattr':JSONObject(rs.resourceattr)})
        if rs.dataset.check_read_permission(user_id, do_raise=False) is False:
            rs_j.dataset['value'] = None
            rs_j.dataset.metadata = JSONObject({})
        scen_j.resourcescenarios.append(rs_j)

    scen_j.resourcegroupitems =[JSONObject(r) for r in rgi_rs]

    return scen_j