def is_magic_packet(data):
    """
    Checks if a packet is a magic packet, returns
    True or False.

    Args:
        data (bytes): the payload from a packet

    """
    data = data.hex().lower()
    prolog = data[:12]
    if prolog == 'f' * 12:
        mac = data[12:24]
        return data == prolog + mac * 16
    else:
        return False
