def __getattr__(self, item):
        for layer in self.layers:
            if layer.layer_name == item:
                return layer
        raise AttributeError()
Allows layers to be retrieved via get attr. For instance: pkt.ip
dataset/ETHPy150Open KimiNewt/pyshark/src/pyshark/packet/packet.py/Packet.__getattr__