code: def _ellipse(
      lst: List[str], max_display: int = 5, sep: str = "|"
  ) -> str:
      """
      Like join, but possibly inserts an ellipsis.
  
      :param lst: The list to join on
      :param int max_display: the number of items to display for ellipsing.
          If -1, shows all items
      :param string sep: the delimiter to join on
      """
      # copy the list (or force it to a list if it's a set)
      choices = list(lst)
      # insert the ellipsis if necessary
      if max_display > 0 and len(choices) > max_display:
          ellipsis = "... ({} of {} shown)".format(
              max_display, len(choices)
          )
          choices = choices[:max_display] + [ellipsis]
      return sep.join(str(c) for c in choices)
  
imports: from collections import deque, OrderedDict
  from typing import Union, Optional, Set, Any, Dict, List, Tuple
  from datetime import timedelta
  import functools
  import math
  import time
  import re
  import shutil
  import json
  import os
  from parlai.core.message import Message
  from parlai.utils.strings import colorize
  from parlai.utils.io import PathManager
  import parlai.utils.logging
label_desc: Use image node_id 9 for calling a global function with example usage: _ellipse(lst, max_display, sep) and returns: sep