code: def install(
      kernel_spec_manager=None,
      user=False,
      kernel_name=KERNEL_NAME,
      display_name=None,
      prefix=None,
      profile=None,
  ):
      """Install the IPython kernelspec for Jupyter
  
      Parameters
      ----------
  
      kernel_spec_manager: KernelSpecManager [optional]
          A KernelSpecManager to use for installation.
          If none provided, a default instance will be created.
      user: bool [default: False]
          Whether to do a user-only install, or system-wide.
      kernel_name: str, optional
          Specify a name for the kernelspec.
          This is needed for having multiple IPython kernels for different environments.
      display_name: str, optional
          Specify the display name for the kernelspec
      profile: str, optional
          Specify a custom profile to be loaded by the kernel.
      prefix: str, optional
          Specify an install prefix for the kernelspec.
          This is needed to install into a non-default location, such as a conda/virtual-env.
  
      Returns
      -------
  
      The path where the kernelspec was installed.
      """
      if kernel_spec_manager is None:
          kernel_spec_manager = KernelSpecManager()
  
      if (kernel_name != KERNEL_NAME) and (display_name is None):
          # kernel_name is specified and display_name is not
          # default display_name to kernel_name
          display_name = kernel_name
      overrides = {}
      if display_name:
          overrides["display_name"] = display_name
      if profile:
          extra_arguments = ["--profile", profile]
          if not display_name:
              # add the profile to the default display name
              overrides["display_name"] = "Python %i [profile=%s]" % (
                  sys.version_info[0],
                  profile,
              )
      else:
          extra_arguments = None
      path = write_kernel_spec(
          overrides=overrides, extra_arguments=extra_arguments
      )
      dest = kernel_spec_manager.install_kernel_spec(
          path, kernel_name=kernel_name, user=user, prefix=prefix
      )
      # cleanup afterward
      shutil.rmtree(path)
      return dest
  
file_path: catboost/contrib/python/ipykernel/py2/ipykernel/kernelspec.py
imports: from __future__ import print_function
  import errno
  import json
  import os
  import shutil
  import sys
  import tempfile
  from jupyter_client.kernelspec import KernelSpecManager
  from traitlets.config import Application
label_desc: Use image node_id 4 for calling a global function with example usage: install(kernel_spec_manager, user, kernel_name, display_name, prefix, profile) and returns: dest