@staticmethod
    def pwm8_to_int(source_int):
        lookup_table = {
                        0: 0,    # 00000000
                        1: 1,    # 00000001
                        2: 136,  # 10001000
                        3: 146,  # 10010010
                        4: 170,  # 10101010
                        5: 186,  # 10111010
                        6: 238,  # 11101110
                        7: 254,  # 11111110
                        8: 255,  # 11111111
                        }

        if 0 <= source_int <= 8:
            return lookup_table[source_int]
        else:
            raise ValueError("Invalid pwm value. (Expected value 0-8)")
dataset/ETHPy150Open missionpinball/mpf/mpf/system/utility_functions.py/Util.pwm8_to_int/original