def print_as_warning(message: str, warning_class: Type[Warning] = UserWarning) -> None:
    """Prints a warning message with custom formatting.

    Temporarily overrides the default warning format to apply custom styling, then
    restores the original formatting after the warning is printed.

    Args:
        message:
            The warning message to print.
        warning_class:
            The type of warning to raise.

    """
    old_format = copy.copy(warnings.formatwarning)
    warnings.formatwarning = _custom_formatwarning
    warnings.warn(message, warning_class)
    warnings.formatwarning = old_format
Prints a warning message with custom formatting.

    Temporarily overrides the default warning format to apply custom styling, then
    restores the original formatting after the warning is printed.

    Args:
        message:
            The warning message to print.
        warning_class:
            The type of warning to raise.

    
lightly/utils/hipify.py