class_docstr: Customizations for the Gitea platform
docstr: At present the only difference from the GHlike implementation
  is the detection of an already existing via a proper 409 response.
code: def repo_create_response(self, r):
      """
      At present the only difference from the GHlike implementation
      is the detection of an already existing via a proper 409 response.
      """
      try:
          response = r.json()
      except Exception as e:
          lgr.debug("Cannot get JSON payload of %s [%s]", r, e)
          response = {}
      lgr.debug("%s responded with %s %s", self.fullname, r, response)
      if r.status_code == requests.codes.created:
          return dict(
              status="ok",
              preexisted=False,
              # perform some normalization
              reponame=response.get("name"),
              private=response.get("private"),
              clone_url=response.get("clone_url"),
              ssh_url=response.get("ssh_url"),
              html_url=response.get("html_url"),
              # and also return in full
              host_response=response,
          )
      elif (
          r.status_code == requests.codes.conflict
          and "already exist" in response.get("message", "")
      ):
          return dict(
              status="impossible",
              message="repository already exists",
              preexisted=True,
          )
      elif r.status_code in (
          self.response_code_unauthorized,
          requests.codes.forbidden,
      ):
          return dict(
              status="error",
              message=("unauthorized: %s", response.get("message")),
          )
      # make sure any error-like situation causes noise
      r.raise_for_status()
      # catch-all
      raise RuntimeError(f"Unexpected host response: {response}")
  
file_path: datalad/datalad/distributed/create_sibling_gitea.py
imports: import logging
  import requests
  from datalad.distributed.create_sibling_ghlike import _create_sibling
  from datalad.distributed.create_sibling_gogs import _GOGS
  from datalad.distribution.dataset import datasetmethod
  from datalad.interface.base import Interface, build_doc, eval_results
label_desc: Use image node_id 1 for calling the _Gitea obj's underlying member method code with example usage: obj.repo_create_response(r) and returns: dict, dict, dict