code: def truncate(s: str, length: int = DEFAULT_CURTAIL) -> str:
      
      if len(s) > length:
          s = s[: length - 1] + '…'
      return s
docs: Truncate a string and add an ellipsis (three dots) to the end if it was too long
  
      :param s: string to possibly truncate
      :param length: length to truncate the string to