You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: source.rb
    path of file: ./repos/dependabot-core/common/lib/dependabot
    
    the code of the file until where you have to start completion: # typed: strict
# frozen_string_literal: true

require "sorbet-runtime"

module Dependabot
  class Source
    extend T::Sig

    GITHUB_SOURCE = %r{
      (?<provider>github)
      (?:\.com)[/:]
      (?<repo>[\w.-]+/(?:[\w.-])+)
      (?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
    }x

    GITHUB_ENTERPRISE_SOURCE = %r{
      (?<protocol>(http://|https://|git://|ssh://))*
      (?<username>[^@]+@)*
      (?<host>[^/]+)
      [/:]
      (?<repo>[\w.-]+/(?:[\w.-])+)
      (?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
    }x

    GITLAB_SOURCE = %r{
      (?<provider>gitlab)
      (?:\.com)[/:]
      (?<repo>[^/]+/(?:[^/])+((?!/tree|/blob/|/-)/[^/]+)?)
      (?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/].*)?
    }x

    BITBUCKET_SOURCE = %r{
      (?<provider>bitbucket)
      (?:\.org)[/:]
      (?<repo>[\w.-]+/(?:[\w.-])+)
      (?:(?:/src)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
    }x

    AZURE_SOURCE = %r{
      (?<provider>azure)
      (?:\.com)[/:]
      (?<repo>[\w.-]+/([\w.-]+/)?(?:_git/)(?:[\w.-])+)
    }x

    CODECOMMIT_SOURCE = %r{
      (?<protocol>(http://|https://|git://|ssh://))
      git[-]
      (?<provider>codecommit)
      (?:.*)
      (?:\.com/
    
    def self.github_enterprise?(base_url)
      resp = Excon.get(File.join(base_url, "status"))
      resp.status == 200 &&
        # Alternatively: resp.headers["Server"] == "GitHub.com", but this
        # currently doesn't work with development environments
        ((resp.headers["X-GitHub-Request-Id"] && !resp.headers["X-GitHub-Request-Id"]&.empty?) || false)
    rescue StandardError
      false
    end

    sig do
      params(
        provider: String,
        repo: String,
        directory: T.nilable(String),
        directories: T.nilable(T::Array[String]),
        branch: T.nilable(String),
        commit: T.nilable(String),
        hostname: T.nilable(String),
        api_endpoint: T.nilable(String)
      ).void
    end
    def initialize(provider:, repo:, directory: nil, directories: nil, branch: nil, commit: nil,
                   hostname: nil, api_endpoint: nil)
      if (hostname.nil? ^ api_endpoint.nil?) && (provider != "codecommit")
        msg = "Both hostname and api_endpoint must be specified if either " \
              "are. Alternatively, both may be left blank to use the " \
              "provider's defaults."
        raise msg
      end

      @provider = provider
      @repo = repo
      @directory = directory
      @directories = directories
      @branch = branch
      @commit = commit
      @hostname = T.let(hostname || default_hostname(provider), String)
      @api_endpoint = T.let(api_endpoint || default_api_endpoint(provider), T.nilable(String))
    end