code: def _path_with_self():
      """Put `jupyter`'s dir at the front of PATH
  
      Ensures that /path/to/jupyter subcommand
      will do /path/to/jupyter-subcommand
      even if /other/jupyter-subcommand is ahead of it on PATH
      """
      path_list = (os.environ.get("PATH") or os.defpath).split(
          os.pathsep
      )
  
      # Insert the "scripts" directory for this Python installation
      # This allows the "jupyter" command to be relocated, while still
      # finding subcommands that have been installed in the default
      # location.
      # We put the scripts directory at the *end* of PATH, so that
      # if the user explicitly overrides a subcommand, that override
      # still takes effect.
      try:
          bindir = sysconfig.get_path("scripts")
      except KeyError:
          # The Python environment does not specify a "scripts" location
          pass
      else:
          path_list.append(bindir)
  
      scripts = [sys.argv[0]]
      if os.path.islink(scripts[0]):
          # include realpath, if `jupyter` is a symlink
          scripts.append(os.path.realpath(scripts[0]))
  
      for script in scripts:
          bindir = os.path.dirname(script)
          if os.path.isdir(bindir) and os.access(
              script, os.X_OK
          ):  # only if it's a script
              # ensure executable's dir is on PATH
              # avoids missing subcommands when jupyter is run via absolute path
              path_list.insert(0, bindir)
      return path_list
  
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 5 for calling a global function with example usage: _path_with_self() and returns: path_list