code: def parse_format_index(self, text):
          
  
          base = 10
          prefix = text[1:3] if text[0] == "-" else text[:2]
          if prefix[0:1] == "0":
              char = prefix[-1]
              if char == "b":
                  base = 2
              elif char == "o":
                  base = 8
              elif char == "x":
                  base = 16
          try:
              text = int(text, base)
          except Exception:
              pass
          return text
docs: Parse format index.