def validate_size_type(parameter: int | Sequence) -> tuple[int, ...]:
        """Validate and convert size parameter to tuple.

        Args:
            parameter: Size as int or sequence of ``(height, width)``

        Returns:
            tuple: Validated size as ``(height, width)``

        Raises:
            TypeError: If parameter type is invalid
            ValueError: If parameter length is not 2
        """
        if isinstance(parameter, int):
            output = (parameter, parameter)
        elif isinstance(parameter, Sequence):
            output = (parameter[0], parameter[1])
        else:
            msg = f"Invalid type {type(parameter)} for tile/stride size. Must be int or Sequence."
            raise TypeError(msg)

        if len(output) != 2:
            msg = f"Size must have length 2, got {len(output)}"
            raise ValueError(msg)

        return output
Validate and convert size parameter to tuple.

        Args:
            parameter: Size as int or sequence of ``(height, width)``

        Returns:
            tuple: Validated size as ``(height, width)``

        Raises:
            TypeError: If parameter type is invalid
            ValueError: If parameter length is not 2
        
src/anomalib/data/utils/tiler.py