code: def to_decimal(text):
      
  
      if not isinstance(text, string_type):
          raise TypeError("expected str or unicode, %s given" % type(text))
  
      if findall(r"[\x00-\x20\x7c-\xff]", text):
          raise ValueError("invalid character in sequence")
  
      text = text.lstrip('!')
      decimal = 0
      length = len(text) - 1
      for i, char in enumerate(text):
          decimal += (ord(char) - 33) * (91 ** (length - i))
  
      return decimal if text != '' else 0
docs: Takes a base91 char string and returns decimal