docs: def decode_nibbles(value):
      """
      The inverse of the Hex Prefix function
      """
      nibbles_with_flag = bytes_to_nibbles(value)
      flag = nibbles_with_flag[0]
  
      needs_terminator = flag in {HP_FLAG_2, HP_FLAG_2 + 1}
      is_odd_length = flag in {HP_FLAG_0 + 1, HP_FLAG_2 + 1}
  
      if is_odd_length:
          raw_nibbles = nibbles_with_flag[1:]
      else:
          raw_nibbles = nibbles_with_flag[2:]
  
      if needs_terminator:
          nibbles = add_nibbles_terminator(raw_nibbles)
      else:
          nibbles = raw_nibbles
  
      return nibbles