def truncate(string, limit=1000):
    """
    Truncate the string to the limit number of
    characters
    """
    if len(string) > limit:
        return string[:limit - 20] + '...' + string[-17:]
    else:
        return string
