code: def ellipsis(source, max_length):
      
      if max_length == 0 or len(source) <= max_length:
          return source
      return source[: max(0, max_length - 3)] + "..."
docs: Truncates a string to be at most max_length long.