code: def display(
      *objs,
      include=None,
      exclude=None,
      metadata=None,
      transient=None,
      display_id=None,
      raw=False,
      clear=False,
      **kwargs,
  ):
      """Display a Python object in all frontends.
  
      By default all representations will be computed and sent to the frontends.
      Frontends can decide which representation is used and how.
  
      In terminal IPython this will be similar to using :func:`print`, for use in richer
      frontends see Jupyter notebook examples with rich display logic.
  
      Parameters
      ----------
      *objs : object
          The Python objects to display.
      raw : bool, optional
          Are the objects to be displayed already mimetype-keyed dicts of raw display data,
          or Python objects that need to be formatted before display? [default: False]
      include : list, tuple or set, optional
          A list of format type strings (MIME types) to include in the
          format data dict. If this is set *only* the format types included
          in this list will be computed.
      exclude : list, tuple or set, optional
          A list of format type strings (MIME types) to exclude in the format
          data dict. If this is set all format types will be computed,
          except for those included in this argument.
      metadata : dict, optional
          A dictionary of metadata to associate with the output.
          mime-type keys in this dictionary will be associated with the individual
          representation formats, if they exist.
      transient : dict, optional
          A dictionary of transient data to associate with the output.
          Data in this dict should not be persisted to files (e.g. notebooks).
      display_id : str, bool optional
          Set an id for the display.
          This id can be used for updating this display area later via update_display.
          If given as `True`, generate a new `display_id`
      clear : bool, optional
          Should the output area be cleared before displaying anything? If True,
          this will wait for additional output before clearing. [default: False]
      **kwargs : additional keyword-args, optional
          Additional keyword-arguments are passed through to the display publisher.
  
      Returns
      -------
      handle: DisplayHandle
          Returns a handle on updatable displays for use with :func:`update_display`,
          if `display_id` is given. Returns :any:`None` if no `display_id` is given
          (default).
  
      Examples
      --------
      >>> class Json(object):
      ...     def __init__(self, json):
      ...         self.json = json
      ...     def _repr_pretty_(self, pp, cycle):
      ...         import json
      ...         pp.text(json.dumps(self.json, indent=2))
      ...     def __repr__(self):
      ...         return str(self.json)
      ...
  
      >>> d = Json({1:2, 3: {4:5}})
  
      >>> print(d)
      {1: 2, 3: {4: 5}}
  
      >>> display(d)
      {
        "1": 2,
        "3": {
          "4": 5
        }
      }
  
      >>> def int_formatter(integer, pp, cycle):
      ...     pp.text('I'*integer)
  
      >>> plain = get_ipython().display_formatter.formatters['text/plain']
      >>> plain.for_type(int, int_formatter)
      <function _repr_pprint at 0x...>
      >>> display(7-5)
      II
  
      >>> del plain.type_printers[int]
      >>> display(7-5)
      2
  
      See Also
      --------
      :func:`update_display`
  
      Notes
      -----
      In Python, objects can declare their textual representation using the
      `__repr__` method. IPython expands on this idea and allows objects to declare
      other, rich representations including:
  
        - HTML
        - JSON
        - PNG
        - JPEG
        - SVG
        - LaTeX
  
      A single object can declare some or all of these representations; all are
      handled by IPython's display system.
  
      The main idea of the first approach is that you have to implement special
      display methods when you define your class, one for each representation you
      want to use. Here is a list of the names of the special methods and the
      values they must return:
  
        - `_repr_html_`: return raw HTML as a string, or a tuple (see below).
        - `_repr_json_`: return a JSONable dict, or a tuple (see below).
        - `_repr_jpeg_`: return raw JPEG data, or a tuple (see below).
        - `_repr_png_`: return raw PNG data, or a tuple (see below).
        - `_repr_svg_`: return raw SVG data as a string, or a tuple (see below).
        - `_repr_latex_`: return LaTeX commands in a string surrounded by "$",
                          or a tuple (see below).
        - `_repr_mimebundle_`: return a full mimebundle containing the mapping
                               from all mimetypes to data.
                               Use this for any mime-type not listed above.
  
      The above functions may also return the object's metadata alonside the
      data.  If the metadata is available, the functions will return a tuple
      containing the data and metadata, in that order.  If there is no metadata
      available, then the functions will return the data only.
  
      When you are directly writing your own classes, you can adapt them for
      display in IPython by following the above approach. But in practice, you
      often need to work with existing classes that you can't easily modify.
  
      You can refer to the documentation on integrating with the display system in
      order to register custom formatters for already existing types
      (:ref:`integrating_rich_display`).
  
      .. versionadded:: 5.4 display available without import
      .. versionadded:: 6.1 display available without import
  
      Since IPython 5.4 and 6.1 :func:`display` is automatically made available to
      the user without import. If you are using display in a document that might
      be used in a pure python context or with older version of IPython, use the
      following import at the top of your file::
  
          from IPython.display import display
  
      """
      from IPython.core.interactiveshell import InteractiveShell
  
      if not InteractiveShell.initialized():
          # Directly print objects.
          print(*objs)
          return
  
      if transient is None:
          transient = {}
      if metadata is None:
          metadata = {}
      if display_id:
          if display_id is True:
              display_id = _new_id()
          transient["display_id"] = display_id
      if kwargs.get("update") and "display_id" not in transient:
          raise TypeError("display_id required for update_display")
      if transient:
          kwargs["transient"] = transient
  
      if not objs and display_id:
          # if given no objects, but still a request for a display_id,
          # we assume the user wants to insert an empty output that
          # can be updated later
          objs = [{}]
          raw = True
  
      if not raw:
          format = InteractiveShell.instance().display_formatter.format
  
      if clear:
          clear_output(wait=True)
  
      for obj in objs:
          if raw:
              publish_display_data(
                  data=obj, metadata=metadata, **kwargs
              )
          else:
              format_dict, md_dict = format(
                  obj, include=include, exclude=exclude
              )
              if not format_dict:
                  # nothing to display (e.g. _ipython_display_ took over)
                  continue
              if metadata:
                  # kwarg-specified metadata gets precedence
                  _merge(md_dict, metadata)
              publish_display_data(
                  data=format_dict, metadata=md_dict, **kwargs
              )
      if display_id:
          return DisplayHandle(display_id)
  
file_path: catboost/contrib/python/ipython/py3/IPython/core/display_functions.py
imports: from binascii import b2a_hex
  import os
  import sys
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: display() and returns: DisplayHandle