from typing import Union


def _to_int(value: Union[str, int]) -> int:
    """Converts a vendor or product ID, specified either in hexadecimal notation
    as a string, or in decimal notation as an integer, to its integer
    representation.

    Parameters:
        value: the value to convert

    Returns:
        the vendor or product ID as an integer
    """
    if isinstance(value, str):
        return int(value, 16)
    else:
        return int(value)