from typing import Union


def ppu2mpp(ppu: int, units: Union[str, int]) -> float:
    """Convert pixels per unit (ppu) to microns per pixel (mpp)

    Args:
        ppu (int):
            Pixels per unit.
        units (Uniont[str, int]):
            Units of pixels per unit. Valid options are "cm",
            "centimeter", "inch", 2 (inches), 3(cm).

    Returns:
        mpp (float):
            Microns per pixel.

    """
    microns_per_unit = {
        "centimeter": 1e4,  # 10,000
        "cm": 1e4,  # 10,000
        "mm": 1e3,  # 1,000
        "inch": 25400,
        "in": 25400,
        2: 25400,  # inches in TIFF tags
        3: 1e4,  # cm in TIFF tags
    }
    if units not in microns_per_unit:
        raise ValueError(f"Invalid units: {units}")
    return 1 / ppu * microns_per_unit[units]