code: def init(
      project_qualified_name=None,
      api_token=None,
      proxies=None,
      backend=None,
      **kwargs,
  ):
      """Initialize `Neptune client library <https://github.com/neptune-ai/neptune-client>`_ to work with
      specific project.
  
      Authorize user, sets value of global variable ``project`` to :class:`~neptune.projects.Project` object
      that can be used to create or list experiments, notebooks, etc.
  
      Args:
          project_qualified_name (:obj:`str`, optional, default is ``None``):
              Qualified name of a project in a form of ``namespace/project_name``.
              If ``None``, the value of ``NEPTUNE_PROJECT`` environment variable will be taken.
  
          api_token (:obj:`str`, optional, default is ``None``):
              User's API token. If ``None``, the value of ``NEPTUNE_API_TOKEN`` environment variable will be taken.
  
              .. note::
  
                  It is strongly recommended to use ``NEPTUNE_API_TOKEN`` environment variable rather than
                  placing your API token in plain text in your source code.
  
          proxies (:obj:`dict`, optional, default is ``None``):
              Argument passed to HTTP calls made via the `Requests <https://2.python-requests.org/en/master/>`_ library.
              For more information see their proxies
              `section <https://2.python-requests.org/en/master/user/advanced/#proxies>`_.
  
              .. note::
  
                  Only `http` and `https` keys are supported by all features.
  
              .. deprecated :: 0.4.4
  
              Instead, use:
  
              .. code :: python3
  
                  from neptune.legacy import HostedNeptuneBackendApiClient
                  neptune.init(backend=HostedNeptuneBackendApiClient(proxies=...))
  
          backend (:class:`~neptune.ApiClient`, optional, default is ``None``):
              By default, Neptune client library sends logs, metrics, images, etc to Neptune servers:
              either publicly available SaaS, or an on-premises installation.
  
              You can also pass the default backend instance explicitly to specify its parameters:
  
              .. code :: python3
  
                  from neptune.legacy import HostedNeptuneBackendApiClient
                  neptune.init(backend=HostedNeptuneBackendApiClient(...))
  
              Passing an instance of :class:`~neptune.OfflineApiClient` makes your code run without communicating
              with Neptune servers.
  
              .. code :: python3
  
                  from neptune.legacy import OfflineApiClient
                  neptune.init(backend=OfflineApiClient())
  
              .. note::
                  Instead of passing a ``neptune.OfflineApiClient`` instance as ``backend``, you can set an
                  environment variable ``NEPTUNE_BACKEND=offline`` to override the default behaviour.
  
      Returns:
          :class:`~neptune.projects.Project` object that is used to create or list experiments, notebooks, etc.
  
      Raises:
          `NeptuneMissingApiTokenException`: When ``api_token`` is None
              and ``NEPTUNE_API_TOKEN`` environment variable was not set.
          `NeptuneMissingProjectQualifiedNameException`: When ``project_qualified_name`` is None
              and ``NEPTUNE_PROJECT`` environment variable was not set.
          `InvalidApiKey`: When given ``api_token`` is malformed.
          `Unauthorized`: When given ``api_token`` is invalid.
  
      Examples:
  
          .. code:: python3
  
              # minimal invoke
              neptune.init()
  
              # specifying project name
              neptune.init('jack/sandbox')
  
              # running offline
              neptune.init(backend=neptune.OfflineApiClient())
      """
  
      _check_for_extra_kwargs(init.__name__, kwargs)
      project_qualified_name = assure_project_qualified_name(
          project_qualified_name
      )
  
      with __lock:
          global session, project
  
          if backend is None:
              backend_name = os.getenv(envs.BACKEND)
              backend = backend_factory(
                  backend_name=backend_name,
                  api_token=api_token,
                  proxies=proxies,
              )
  
          session = Session(backend=backend)
          project = session.get_project(project_qualified_name)
  
          return project
  
imports: import logging
  import os
  import threading
  from neptune.common.utils import assure_project_qualified_name
  from neptune.legacy import constants, envs
  from neptune.legacy.exceptions import InvalidNeptuneBackend, NeptuneIncorrectImportException, NeptuneUninitializedException
  from neptune.legacy.internal.api_clients.backend_factory import backend_factory
  from neptune.legacy.internal.utils.deprecation import legacy_client_deprecation
  from neptune.legacy.projects import Project
  from neptune.legacy.sessions import Session
label_desc: Use image node_id 2 for calling a global function with example usage: init(project_qualified_name, api_token, proxies, backend) and returns: project