def _msg_head_str(msg):
    """A utility to print the head of the str representation of an object."""
    msg_limit = 32
    msg_str = f"'{msg}'"
    if len(msg_str) > msg_limit:
        msg_str = msg_str[:msg_limit] + "'..."
    return msg_str
