<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ofp_msg_from_jsondict(dp, jsondict):
 """ This function instanticates an appropriate OpenFlow message class from the given JSON style dictionary. The objects created by following two code fragments are equivalent. Code A:: jsonstr = '{ "OFPSetConfig": { "flags": 0, "miss_send_len": 128 } }' jsondict = json.loads(jsonstr) o = ofp_msg_from_jsondict(dp, jsondict) Code B:: o = dp.ofproto_parser.OFPSetConfig(flags=0, miss_send_len=128) This function takes the following arguments. ======== ======================================= Argument Description ======== ======================================= dp An instance of ryu.controller.Datapath. jsondict A JSON style dict. ======== ======================================= """

    parser = dp.ofproto_parser
    assert len(jsondict) == 1
    for k, v in jsondict.items():
        cls = getattr(parser, k)
        assert issubclass(cls, MsgBase)
        return cls.from_jsondict(v, datapath=dp)