code: def check4real(
      testcmd,
      testdir,
      credential,
      api,
      delete_endpoint,
      access_protocol="https",
      moretests=None,
  ):
      token_var = f"DATALAD_CREDENTIAL_{credential.upper()}_TOKEN"
      if token_var not in os.environ:
          raise SkipTest(f"No {credential} access token available")
  
      ds = Dataset(testdir).create()
      assert_raises(
          ValueError,
          testcmd,
          "somerepo",
          dataset=ds,
          api=api,
          credential="bogus",
      )
  
      reponame = basename(testdir).replace("datalad_temp_test", "dltst")
      try:
          res = testcmd(
              reponame,
              dataset=ds,
              api=api,
              credential=credential,
              name="ghlike-sibling",
              access_protocol=access_protocol,
          )
          assert_in_results(
              res,
              status="ok",
              preexisted=False,
              reponame=reponame,
              private=False,
          )
          assert_in_results(
              res,
              status="ok",
              action="configure-sibling",
              name="ghlike-sibling",
          )
          # now do it again
          ds.siblings(
              "remove",
              name="ghlike-sibling",
              result_renderer="disabled",
          )
          res = testcmd(
              reponame,
              dataset=ds,
              api=api,
              credential=credential,
              access_protocol=access_protocol,
              on_failure="ignore",
          )
          assert_result_count(res, 1)
          assert_in_results(
              res,
              status="impossible",
              message="repository already exists",
              preexisted=True,
          )
          # existing=skip must not "fix" this:
          # https://github.com/datalad/datalad/issues/5941
          res = testcmd(
              reponame,
              dataset=ds,
              api=api,
              existing="skip",
              access_protocol=access_protocol,
              credential=credential,
              on_failure="ignore",
          )
          assert_result_count(res, 1)
          assert_in_results(
              res,
              status="error",
              preexisted=True,
          )
          # but existing=reconfigure does
          res = testcmd(
              reponame,
              dataset=ds,
              api=api,
              existing="reconfigure",
              access_protocol=access_protocol,
              credential=credential,
          )
          assert_result_count(res, 2)
          assert_in_results(
              res,
              status="notneeded",
              preexisted=True,
          )
          assert_in_results(
              res,
              action="configure-sibling",
              status="ok",
          )
          if moretests:
              moretests(ds)
      finally:
          token = os.environ[token_var]
          requests.delete(
              "{}/{}".format(
                  api, delete_endpoint.format(reponame=reponame)
              ),
              headers={
                  "user-agent": DEFAULT_USER_AGENT,
                  "authorization": f"token {token}",
              },
          ).raise_for_status()
  
file_path: datalad/datalad/distributed/tests/test_create_sibling_ghlike.py
imports: import os
  from os.path import basename
  from unittest.mock import patch
  import requests
  from datalad.api import Dataset, create_sibling_gin
  from datalad.downloaders.http import DEFAULT_USER_AGENT
  from datalad.tests.utils_pytest import SkipTest, assert_in, assert_in_results, assert_raises, assert_result_count, assert_status, eq_, with_tempfile
label_desc: Use image node_id 3 for calling a global function with example usage: check4real(testcmd, testdir, credential, api, delete_endpoint, access_protocol, moretests) without return types