def percentage(value, refer_to):
    """Return the evaluated percentage value, or the value unchanged."""
    if value == 'auto':
        return value
    elif value.unit == 'px':
        return value.value
    else:
        assert value.unit == '%'
        return refer_to * value.value / 100
dataset/ETHPy150Open Kozea/WeasyPrint/weasyprint/layout/backgrounds.py/percentage/original