def dedicated_type(text: bytes, type: str) -> Any:
    """Transform a PDF basic type into a Python basic type."""
    if type == 'INTEGER':
        return int(text)
    elif type == 'REAL':
        return float(text)
    elif type == 'TRUE':
        return True
    elif type == 'FALSE':
        return False
    elif type == 'KEYWORD' or type == 'NAME':
        return text.decode('ascii')
    else:
        return text
Transform a PDF basic type into a Python basic type.
pdfsyntax/objects.py