

def _receive_ping_frame(self, frame):
    '\n        Receive a PING frame on the connection.\n        '
    events = self.state_machine.process_input(ConnectionInputs.RECV_PING)
    flags = []
    if ('ACK' in frame.flags):
        evt = PingAcknowledged()
        evt.ping_data = frame.opaque_data
        events.append(evt)
    else:
        f = PingFrame(0)
        f.flags = set(['ACK'])
        f.opaque_data = frame.opaque_data
        flags.append(f)
    return (flags, events)

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection._receive_ping_frame/original