class_docstr: Creates, and optionally checks out, a Databricks Repo using the POST api/2.0/repos API endpoint.
  
   See: https://docs.databricks.com/dev-tools/api/latest/repos.html#operation/create-repo
  
  :param git_url: Required HTTPS URL of a Git repository
  :param git_provider: Optional name of Git provider. Must be provided if we can't guess its name from URL.
  :param repo_path: optional path for a repository. Must be in the format ``/Repos/{folder}/{repo-name}``.
      If not specified, it will be created in the user's directory.
  :param branch: optional name of branch to check out.
  :param tag: optional name of tag to checkout.
  :param ignore_existing_repo: don't throw exception if repository with given path already exists.
  :param databricks_conn_id: Reference to the :ref:`Databricks connection <howto/connection:databricks>`.
      By default and in the common case this will be ``databricks_default``. To use
      token based authentication, provide the key ``token`` in the extra field for the
      connection and create the key ``host`` and leave the ``host`` field empty. (templated)
  :param databricks_retry_limit: Amount of times retry if the Databricks backend is
      unreachable. Its value must be greater than or equal to 1.
  :param databricks_retry_delay: Number of seconds to wait between retries (it
          might be a floating point number).
class_docstr_tok: ["Creates",",","and","optionally","checks","out",",","a","Databricks","Repo","using","the","POST","api\/2.0\/repos","API","endpoint",".","See",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/repos.html","#","operation\/create-repo",":","param","git_url",":","Required","HTTPS","URL","of","a","Git","repository",":","param","git_provider",":","Optional","name","of","Git","provider",".","Must","be","provided","if","we","ca","n't","guess","its","name","from","URL",".",":","param","repo_path",":","optional","path","for","a","repository",".","Must","be","in","the","format","``","\/Repos\/","{","folder","}","\/","{","repo-name","}","``",".","If","not","specified",",","it","will","be","created","in","the","user","'s","directory",".",":","param","branch",":","optional","name","of","branch","to","check","out",".",":","param","tag",":","optional","name","of","tag","to","checkout",".",":","param","ignore_existing_repo",":","do","n't","throw","exception","if","repository","with","given","path","already","exists",".",":","param","databricks_conn_id",":","Reference","to","the",":","ref",":","`","Databricks","connection","<","howto\/connection",":","databricks",">","`",".","By","default","and","in","the","common","case","this","will","be","``","databricks_default","``",".","To","use","token","based","authentication",",","provide","the","key","``","token","``","in","the","extra","field","for","the","connection","and","create","the","key","``","host","``","and","leave","the","``","host","``","field","empty",".","(","templated",")",":","param","databricks_retry_limit",":","Amount","of","times","retry","if","the","Databricks","backend","is","unreachable",".","Its","value","must","be","greater","than","or","equal","to","1.",":","param","databricks_retry_delay",":","Number","of","seconds","to","wait","between","retries","(","it","might","be","a","floating","point","number",")","."]
docstr: Create a Databricks Repo.
  
  :param context: context
  :return: Repo ID
docstr_tok: ["Create","a","Databricks","Repo",".",":","param","context",":","context",":","return",":","Repo","ID"]
code: def execute(self, context: Context):
      """
      Create a Databricks Repo.
  
      :param context: context
      :return: Repo ID
      """
      payload = {
          "url": self.git_url,
          "provider": self.git_provider,
      }
      if self.repo_path is not None:
          if not self.__repos_path_regexp__.match(self.repo_path):
              raise AirflowException(
                  f"repo_path should have form of /Repos/{{folder}}/{{repo-name}}, got '{self.repo_path}'"
              )
          payload["path"] = self.repo_path
      existing_repo_id = None
      if self.repo_path is not None:
          existing_repo_id = self._hook.get_repo_by_path(self.repo_path)
          if (
              existing_repo_id is not None
              and not self.ignore_existing_repo
          ):
              raise AirflowException(
                  f"Repo with path '{self.repo_path}' already exists"
              )
      if existing_repo_id is None:
          result = self._hook.create_repo(payload)
          repo_id = result["id"]
      else:
          repo_id = existing_repo_id
      # update repo if necessary
      if self.branch is not None:
          self._hook.update_repo(
              str(repo_id), {"branch": str(self.branch)}
          )
      elif self.tag is not None:
          self._hook.update_repo(str(repo_id), {"tag": str(self.tag)})
  
      return repo_id
  
imports: from __future__ import annotations
  import re
  from functools import cached_property
  from typing import TYPE_CHECKING, Sequence
  from urllib.parse import urlsplit
  from airflow.exceptions import AirflowException
  from airflow.models import BaseOperator
  from airflow.providers.databricks.hooks.databricks import DatabricksHook
label_desc: Use image node_id 4 for calling the DatabricksReposCreateOperator obj's underlying member method code with example usage: obj.execute(context) and returns: repo_id