code: def encode_images(format_dict):
      """b64-encodes images in a displaypub format dict
  
      Perhaps this should be handled in json_clean itself?
  
      Parameters
      ----------
      format_dict : dict
          A dictionary of display data keyed by mime-type
  
      Returns
      -------
      format_dict : dict
          A copy of the same dictionary,
          but binary image data ('image/png', 'image/jpeg' or 'application/pdf')
          is base64-encoded.
  
      """
  
      # no need for handling of ambiguous bytestrings on Python 3,
      # where bytes objects always represent binary data and thus
      # base64-encoded.
      return format_dict
  
file_path: catboost/contrib/python/ipykernel/py3/ipykernel/jsonutil.py
imports: import math
  import numbers
  import re
  import types
  from binascii import b2a_base64
  from datetime import date, datetime
  from jupyter_client._version import version_info
label_desc: Use image node_id 1 for calling a global function with example usage: encode_images(format_dict) and returns: format_dict