code: def strlimit (s, length=72):
      
      assert length >= 0, "length limit must be a non-negative integer"
      if not s or len(s) <= length:
          return s
      if length == 0:
          return ""
      return "%s..." % s[:length]
docs: If the length of the string exceeds the given limit, it will be cut
      off and three dots will be appended.
  
      @param s: the string to limit
      @type s: string
      @param length: maximum length
      @type length: non-negative integer
      @return: limited string, at most length+3 characters long