def _repr(obj, clip=80):
    """Clip long repr() string.
    """
    try:
        r = repr(obj)
    except Exception:
        r = 'N/A'
    if 0 < clip < len(r):
        h = clip // 2 - 2
        if h > 0:
            r = r[:h] + '....' + r[-h:]
    return r
