<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def packets_to_flows(self):
 """Combine packets into flows"""


        # For each packet, place it into either an existing flow or a new flow
        for packet in self.input_stream:

            # Compute flow tuple and add the packet to the flow
            flow_id = flow_utils.flow_tuple(packet)
            self._flows[flow_id].add_packet(packet)

            # Yield flows that are ready to go
            for flow in list(self._flows.values()):
                if flow.ready():
                    flow_info = flow.get_flow()
                    yield flow_info
                    del self._flows[flow_info['flow_id']]

        # All done so just dump what we have left
        print('---- NO MORE INPUT ----')
        for flow in sorted(self._flows.values(), key=lambda x: x.meta['start']):
            yield flow.get_flow()