def _raw(s):
    """Get raw representation of s, truncating if too long."""

    if isinstance(s, list):
        s = "\n".join(_raw(item) for item in s)

    if s == EOF:
        return "EOF"

    s = repr(s)  # Get raw representation of string
    s = s[1:-1]  # Strip away quotation marks
    if len(s) > 15:
        s = s[:15] + "..."  # Truncate if too long
    return s
Get raw representation of s, truncating if too long.