def get_decimal(digit: int | str) -> int:
    """
    Convert a decimal, binary, hexadecimal, or octal to an integer.

    Args:
        digit (int | str): The digit to be converted. Non-decimal
        numbers must begin with their associated prefix (binary = '0b',
        hexadecimal = '0x', octal = '0o').
    Raises:
        TypeError: If digit is neither an integer or str.

    Returns:
        int: digit's integer decimal value.
    """
    if isinstance(digit, int) or (isinstance(digit, str)
                                  and digit.isdecimal()):
        return int(digit)
    if not isinstance(digit, str):
        raise TypeError()
    bases = {'0x': 16, '0b': 2, '0o': 8}
    decimal = int(digit, bases[digit[:2]])
    return decimal