""" Formatting utilities for the GuardBench Leaderboard. """ import pandas as pd import numpy as np def make_clickable_model(model_name: str) -> str: """ Create a clickable link for a model name. """ return f'{model_name}' def has_no_nan_values(df: pd.DataFrame, columns: list) -> pd.Series: """ Check if a row has no NaN values in the specified columns. """ return ~df[columns].isna().any(axis=1) def format_percentage(value: float) -> str: """ Format a value as a percentage. """ if pd.isna(value): return "N/A" return f"{value * 100:.2f}%" def format_number(value: float, precision: int = 2) -> str: """ Format a number with specified precision. """ if pd.isna(value): return "N/A" return f"{value:.{precision}f}" def styled_message(message: str) -> str: """ Format a success message with styling. """ return f"""