def METHOD_NAME(self, values_in, bits_per_value, bits_per_symbol):
    # verify that 8 is divisible by bits_per_symbol
    m = bits_per_value / bits_per_symbol
    # print(m)
    mask = 2**(bits_per_symbol) - 1
    if bits_per_value != m * bits_per_symbol:
        print(
            "error - bits per symbols must fit nicely into bits_per_value bit values")
        return []
    num_values = len(values_in)
    num_symbols = int(num_values * (m))
    cur_byte = 0
    cur_bit = 0
    out = []
    for i in range(num_symbols):
        s = (
            values_in[cur_byte] >> (
                bits_per_value -
                bits_per_symbol -
                cur_bit)) & mask
        out.append(s)
        cur_bit += bits_per_symbol
        if cur_bit >= bits_per_value:
            cur_bit = 0
            cur_byte += 1
    return out