code: def _enable_remote(ds, repo, name, res_kwargs, **unused_kwargs):
      result_props = dict(
          action="enable-sibling",
          path=ds.path,
          type="sibling",
          name=name,
          **res_kwargs,
      )
  
      if not isinstance(repo, AnnexRepo):
          yield dict(
              result_props,
              status="impossible",
              message="cannot enable sibling of non-annex dataset",
          )
          return
  
      if name is None:
          yield dict(
              result_props,
              status="error",
              message="require `name` of sibling to enable",
          )
          return
  
      # get info on special remote
      sp_remotes = {
          v["name"]: dict(v, uuid=k)
          for k, v in repo.get_special_remotes().items()
      }
      remote_info = sp_remotes.get(name, None)
  
      if remote_info is None:
          yield dict(
              result_props,
              status="impossible",
              message=("cannot enable sibling '%s', not known", name),
          )
          return
  
      env = None
      cred = None
      if remote_info.get("type", None) == "webdav":
          # a webdav special remote -> we need to supply a username and password
          if not (
              "WEBDAV_USERNAME" in os.environ
              and "WEBDAV_PASSWORD" in os.environ
          ):
              # nothing user-supplied
              # let's consult the credential store
              hostname = urlparse(remote_info.get("url", "")).netloc
              if not hostname:
                  yield dict(
                      result_props,
                      status="impossible",
                      message="cannot determine remote host, credential lookup for webdav access is not possible, and not credentials were supplied",
                  )
              cred = UserPassword("webdav:{}".format(hostname))
              if not cred.is_known:
                  try:
                      cred.enter_new(
                          instructions="Enter credentials for authentication with WEBDAV server at {}".format(
                              hostname
                          ),
                          user=os.environ.get("WEBDAV_USERNAME", None),
                          password=os.environ.get(
                              "WEBDAV_PASSWORD", None
                          ),
                      )
                  except KeyboardInterrupt:
                      # user hit Ctrl-C
                      yield dict(
                          result_props,
                          status="impossible",
                          message="credentials are required for sibling access, abort",
                      )
                      return
              creds = cred()
              # update the env with the two necessary variable
              # we need to pass a complete env because of #1776
              env = dict(
                  os.environ,
                  WEBDAV_USERNAME=creds["user"],
                  WEBDAV_PASSWORD=creds["password"],
              )
  
      try:
          repo.enable_remote(name, env=env)
          result_props["status"] = "ok"
      except AccessDeniedError as e:
          # credentials are wrong, wipe them out
          if cred and cred.is_known:
              cred.delete()
          result_props["status"] = "error"
          result_props["message"] = str(e)
      except AccessFailedError as e:
          # some kind of connection issue
          result_props["status"] = "error"
          result_props["message"] = str(e)
      except Exception as e:
          # something unexpected
          raise e
  
      yield result_props
  
imports: import logging
  import os
  import os.path
  from urllib.parse import urlparse
  import datalad.support.ansi_colors
  from datalad.distribution.dataset import Dataset, require_dataset
  from datalad.distribution.update import Update
  from datalad.downloaders.credentials import UserPassword
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import annex_group_opt, annex_groupwanted_opt, annex_required_opt, annex_wanted_opt, as_common_datasrc, inherit_opt, location_description, publish_by_default, publish_depends, recursion_flag, recursion_limit
  from datalad.interface.results import get_status_dict
  from datalad.interface.utils import generic_result_renderer
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.constraints import EnsureBool, EnsureChoice, EnsureNone, EnsureStr
  from datalad.support.exceptions import AccessDeniedError, AccessFailedError, CapturedException, CommandError, DownloadError, InsufficientArgumentsError, RemoteNotAvailableError
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import RI, URL, PathRI
  from datalad.support.param import Parameter
  from datalad.utils import Path, ensure_list, slash_join
  from .dataset import EnsureDataset, datasetmethod
label_desc: Use image node_id 6 for calling a global function with example usage: _enable_remote(ds, repo, name, res_kwargs) without return types