class_docstr: :class:`KernelProvisionerFactory` is responsible for creating provisioner instances.
  
  A singleton instance, `KernelProvisionerFactory` is also used by the :class:`KernelSpecManager`
  to validate `kernel_provisioner` references found in kernel specifications to confirm their
  availability (in cases where the kernel specification references a kernel provisioner that has
  not been installed into the current Python environment).
  
  It's ``default_provisioner_name`` attribute can be used to specify the default provisioner
  to use when a kernel_spec is found to not reference a provisioner.  It's value defaults to
  `"local-provisioner"` which identifies the local provisioner implemented by
  :class:`LocalProvisioner`.
class_docstr_tok: [":","class",":","`","KernelProvisionerFactory","`","is","responsible","for","creating","provisioner","instances",".","A","singleton","instance",",","`","KernelProvisionerFactory","`","is","also","used","by","the",":","class",":","`","KernelSpecManager","`","to","validate","`","kernel_provisioner","`","references","found","in","kernel","specifications","to","confirm","their","availability","(","in","cases","where","the","kernel","specification","references","a","kernel","provisioner","that","has","not","been","installed","into","the","current","Python","environment",")",".","It","'s","``","default_provisioner_name","``","attribute","can","be","used","to","specify","the","default","provisioner","to","use","when","a","kernel_spec","is","found","to","not","reference","a","provisioner",".","It","'s","value","defaults","to","`","``","local-provisioner","''","`","which","identifies","the","local","provisioner","implemented","by",":","class",":","`","LocalProvisioner","`","."]
docstr: Wrapper around entry_points (to fetch a single provisioner) - primarily to facilitate testing.
docstr_tok: ["Wrapper","around","entry_points","(","to","fetch","a","single","provisioner",")","-","primarily","to","facilitate","testing","."]
code: def _get_provisioner(self, name: str) -> EntryPoint:
      """Wrapper around entry_points (to fetch a single provisioner) - primarily to facilitate testing."""
      eps = entry_points(
          group=KernelProvisionerFactory.GROUP_NAME, name=name
      )
      if eps:
          return eps[0]
  
      # Check if the entrypoint name is 'local-provisioner'.  Although this should never
      # happen, we have seen cases where the previous distribution of jupyter_client has
      # remained which doesn't include kernel-provisioner entrypoints (so 'local-provisioner'
      # is deemed not found even though its definition is in THIS package).  In such cases,
      # the entrypoints package uses what it first finds - which is the older distribution
      # resulting in a violation of a supposed invariant condition.  To address this scenario,
      # we will log a warning message indicating this situation, then build the entrypoint
      # instance ourselves - since we have that information.
      if name == "local-provisioner":
          distros = glob.glob(
              f"{path.dirname(path.dirname(__file__))}-*"
          )
          self.log.warning(
              f"Kernel Provisioning: The 'local-provisioner' is not found.  This is likely "
              f"due to the presence of multiple jupyter_client distributions and a previous "
              f"distribution is being used as the source for entrypoints - which does not "
              f"include 'local-provisioner'.  That distribution should be removed such that "
              f"only the version-appropriate distribution remains (version >= 7).  Until "
              f"then, a 'local-provisioner' entrypoint will be automatically constructed "
              f"and used.\nThe candidate distribution locations are: {distros}"
          )
          return EntryPoint(
              "local-provisioner",
              "jupyter_client.provisioning",
              "LocalProvisioner",
          )
  
      raise
  
file_path: catboost/contrib/python/jupyter-client/py3/jupyter_client/provisioning/factory.py
imports: import glob
  import sys
  from os import getenv, path
  from typing import Any, Dict, List
  from traitlets.config import SingletonConfigurable, Unicode, default
  from .provisioner_base import KernelProvisionerBase
label_desc: Use image node_id 9 for calling the KernelProvisionerFactory obj's underlying member method code with example usage: obj._get_provisioner(name) and returns: eps, EntryPoint