def _center_just(text: str, width: int):
    """Pads the provided string left and right such that it has a specified width and is centered.

    Args:
        text (str): The string to pad.
        width (int): The desired width of the padded ``text``.

    Returns:
        str: The padded ``text``.
    """

    len_diff = width - len(text)
    if len_diff <= 0:
        return text

    pad_before = len_diff // 2
    pad_after = len_diff - pad_before

    return (" " * pad_before) + text + (" " * pad_after)