code: def main():
      if len(sys.argv) > 1 and not sys.argv[1].startswith("-"):
          # Don't parse if a subcommand is given
          # Avoids argparse gobbling up args passed to subcommand, such as `-h`.
          subcommand = sys.argv[1]
      else:
          parser = jupyter_parser()
          args, opts = parser.parse_known_args()
          subcommand = args.subcommand
          if args.version:
              print("{:<17}:".format("jupyter core"), __version__)
              for package, name in [
                  ("notebook", "jupyter-notebook"),
                  ("qtconsole", "qtconsole"),
                  ("IPython", "ipython"),
                  ("ipykernel", "ipykernel"),
                  ("jupyter_client", "jupyter client"),
                  ("jupyterlab", "jupyter lab"),
                  ("nbconvert", "nbconvert"),
                  ("ipywidgets", "ipywidgets"),
                  ("nbformat", "nbformat"),
                  ("traitlets", "traitlets"),
              ]:
                  version = None
                  try:
                      mod = __import__(package)
                      version = mod.__version__
                  except ImportError:
                      version = "not installed"
                  print("{:<17}:".format(name), version)
              return
          if args.json and not args.paths:
              sys.exit("--json is only used with --paths")
          if args.config_dir:
              print(paths.jupyter_config_dir())
              return
          if args.data_dir:
              print(paths.jupyter_data_dir())
              return
          if args.runtime_dir:
              print(paths.jupyter_runtime_dir())
              return
          if args.paths:
              data = {}
              data["runtime"] = [paths.jupyter_runtime_dir()]
              data["config"] = paths.jupyter_config_path()
              data["data"] = paths.jupyter_path()
              if args.json:
                  print(json.dumps(data))
              else:
                  for name in sorted(data):
                      path = data[name]
                      print("%s:" % name)
                      for p in path:
                          print("    " + p)
              return
  
      if not subcommand:
          parser.print_usage(file=sys.stderr)
          sys.exit("subcommand is required")
  
      command = _jupyter_abspath(subcommand)
  
      try:
          _execvp(command, sys.argv[1:])
      except OSError as e:
          sys.exit(
              "Error executing Jupyter command %r: %s" % (subcommand, e)
          )
  
file_path: catboost/contrib/python/jupyter-core/py2/jupyter_core/command.py
imports: from __future__ import print_function
  import argparse
  import errno
  import json
  import os
  import sys
  import sysconfig
  from subprocess import Popen
  from .None import paths
  from .version import __version__
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types