class_docstr: Arithmetic coding
  
  https://github.com/gw-c/arith
  http://www.drdobbs.com/cpp/data-compression-with-arithmetic-encodin/240169251
  https://en.wikipedia.org/wiki/Arithmetic_coding
code: def __init__(
      self, base: int = 2, terminator: str | None = None, qval: int = 1
  ) -> None:
      self.base = base
      self.terminator = terminator
      self.qval = qval
  
imports: from __future__ import annotations
  import codecs
  import math
  from collections import Counter
  from fractions import Fraction
  from itertools import groupby, permutations
  from typing import Any, Sequence, TypeVar
  from .base import Base
label_desc: Use image node_id 1 to create a new ArithNCD object from inherited base classes: _NCDBase with example: obj = ArithNCD(base, terminator, qval)