<commit_before>from io import BytesIO



class BinaryMessageExamples:

    class GetStateWhenAllRelaysAreOff:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class GetStateWhenEightOfSixteenRelaysAreOn:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        request  = bytes.fromhex("22 01 10 00 00 AA AA 87")

    class GetStateWhenAllRelaysAreOn:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 FF FF 31")
        
    class TurnOnRelay1:
        request  = bytes.fromhex("55 01 12 00 00 00 01 69  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 01 34")

    class TurnOffRelay1:
        request  = bytes.fromhex("55 01 11 00 00 00 01 68  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOffRelay2:
        request  = bytes.fromhex("55 01 12 00 00 00 02 6A  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 02 35")

    class TurnOffRelay2:
        request  = bytes.fromhex("55 01 11 00 00 00 02 69  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOnRelay3:
        request  = bytes.fromhex("55 01 12 00 00 00 03 6B  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 04 37") 

    class TurnOffRelay3:
        request  = bytes.fromhex("55 01 11 00 00 00 03 6A  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOnRelay16:
        request  = bytes.fromhex("55 01 12 00 00 00 10 78  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 80 00 B3")

    class TurnOffRelay16:
        request  = bytes.fromhex("55 01 11 00 00 00 10 77  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

<commit_msg>reverse engineering: a possibility of multiple relay modules is discovered<commit_after>from io import BytesIO



class BinaryMessageExamples:

    class GetStateWhenAllRelaysAreOff:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class GetStateWhenEightOfSixteenRelaysAreOn:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        request  = bytes.fromhex("22 01 10 00 00 AA AA 87")

    class GetStateWhenAllRelaysAreOn:
        request  = bytes.fromhex("55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 FF FF 31")
        
    class TurnOnRelay1:
        request  = bytes.fromhex("55 01 12 00 00 00 01 69  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 01 34")

    class TurnOffRelay1:
        request  = bytes.fromhex("55 01 11 00 00 00 01 68  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOffRelay2:
        request  = bytes.fromhex("55 01 12 00 00 00 02 6A  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 02 35")

    class TurnOffRelay2:
        request  = bytes.fromhex("55 01 11 00 00 00 02 69  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOnRelay3:
        request  = bytes.fromhex("55 01 12 00 00 00 03 6B  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 04 37") 

    class TurnOffRelay3:
        request  = bytes.fromhex("55 01 11 00 00 00 03 6A  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class TurnOnRelay16:
        request  = bytes.fromhex("55 01 12 00 00 00 10 78  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 80 00 B3")

    class TurnOffRelay16:
        request  = bytes.fromhex("55 01 11 00 00 00 10 77  55 01 10 00 00 00 00 66")
        response = bytes.fromhex("22 01 10 00 00 00 00 33")

    class GetStateOfSecondRelayModule:
        request  = bytes.fromhex("55 02 10 00 00 00 00 67")

    class TurnOffRleay1module2:
        request  = bytes.fromhex("55 02 12 00 00 00 01 6A 55 02 10 00 00 00 00 67")


{'fraction_non_alphanumeric': 0.07402970771442262, 'fraction_numerical': 0.24077623382846192, 'mean_word_length': 2.2925867507886437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3454953', 'n_tokens_mistral': 2284, 'n_tokens_neox': 1319, 'n_words': 619}