code: def as_int(self, val: Tuple[str]) -> int:
          
          res = 0
          try:
              for b in val:
                  res += 1 << self.bit[b]
          except KeyError:
              return None
          return res
docs: Transform a "bits" value to an integer.