<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 """Truncates a string, starting from 'lim' chars. The given object can be a string, or something that can be casted to a string. '11258999060' """

    if isinstance(obj, basestring) or not use_repr:
        full = str(obj)
    else:
        full = repr(obj)
    postfix = []
    CLOSERS = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'", '<': '>'}
    for i, c in enumerate(full):
        if i >= lim + len(postfix):
            return full[:i] + dots + ''.join(reversed(postfix))
        if postfix and postfix[-1] == c:
            postfix.pop(-1)
            continue
        closer = CLOSERS.get(c, None)
        if closer is not None:
            postfix.append(closer)
    return full