<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def build_from_packet(pkt):
        '''
        Build and return a new OpenflowMatch object based on the
        packet object passed as a parameter.
        '''
        m = OpenflowMatch()
        for mf,pkttuple in OpenflowMatch._match_field_to_packet.items():
            for pktcls,field in pkttuple:
                if pkt.has_header(pktcls):
                    setattr(m, mf, getattr(pkt[pktcls], field))
                    continue
        return m