code: def from_yang(self, text: str) -> Optional[int]:
          
          if text.startswith("0"):
              base = 16 if text.startswith("0x") else 8
          else:
              base = 10
          try:
              return int(text, base)
          except (ValueError, TypeError):
              raise InvalidArgument(text)
docs: Override the superclass method.