def _maybe_truncate(obj, maxlen=500):
    s = str(obj)
    if len(s) > maxlen:
        s = s[:(maxlen - 3)] + '...'
    return s
dataset/ETHPy150Open pydata/xarray/xarray/core/formatting.py/_maybe_truncate/original