def __getitem__(self, index):
        "Allow to access value array by index"
        if not self.__is_value_array:
            raise ValueError("Report item is not value usage array")
        if index < self.__report_count:
            byte_index = int( (index * self.__bit_size) // 8 )
            bit_index = (index * self.__bit_size) % 8
            return ((self.__value[byte_index] >> bit_index) & \
                    ((1 << self.__bit_size) - 1) )
        else:
            raise IndexError
def __getitem__ ( self , index ) : if not self . __is_value_array : raise ValueError ( "Report item is not value usage array" ) if index < self . __report_count : byte_index = int ( ( index * self . __bit_size ) // 8 ) bit_index = ( index * self . __bit_size ) % 8 return ( ( self . __value [ byte_index ] >> bit_index ) & ( ( 1 << self . __bit_size ) - 1 ) ) else : raise IndexError
Allow to access value array by index