parameters: (cls, url)
return_statement: return url, rev, user_pass
docstring: Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
          That's required because although they use SSH they sometimes don't
          work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
          parsing. Hence we remove it again afterwards and return it as a stub.
docstring_summary: Prefixes stub URLs like 'user
docstring_tokens: Prefixes stub URLs like user
function: def get_url_rev_and_auth(cls, url):
          # type: (str) -> Tuple[str, Optional[str], AuthInfo]
          """
          Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
          That's required because although they use SSH they sometimes don't
          work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
          parsing. Hence we remove it again afterwards and return it as a stub.
          """
          # Works around an apparent Git bug
          # (see https://article.gmane.org/gmane.comp.version-control.git/146500)
          scheme, netloc, path, query, fragment = urlsplit(url)
          if scheme.endswith('file'):
              initial_slashes = path[:-len(path.lstrip('/'))]
              newpath = (
                  initial_slashes +
                  urllib.request.url2pathname(path)
                  .replace('\\', '/').lstrip('/')
              )
              after_plus = scheme.find('+') + 1
              url = scheme[:after_plus] + urlunsplit(
                  (scheme[after_plus:], netloc, newpath, query, fragment),
              )
  
          if '://' not in url:
              assert 'file:' not in url
              url = url.replace('git+', 'git+ssh://')
              url, rev, user_pass = super().get_url_rev_and_auth(url)
              url = url.replace('ssh://', '')
          else:
              url, rev, user_pass = super().get_url_rev_and_auth(url)
  
          return url, rev, user_pass
function_tokens: def get_url_rev_and_auth ( cls , url ) : # type: (str) -> Tuple[str, Optional[str], AuthInfo] # Works around an apparent Git bug # (see https://article.gmane.org/gmane.comp.version-control.git/146500) scheme , netloc , path , query , fragment = urlsplit ( url ) if scheme . endswith ( 'file' ) : initial_slashes = path [ : - len ( path . lstrip ( '/' ) ) ] newpath = ( initial_slashes + urllib . request . url2pathname ( path ) . replace ( '\\' , '/' ) . lstrip ( '/' ) ) after_plus = scheme . find ( '+' ) + 1 url = scheme [ : after_plus ] + urlunsplit ( ( scheme [ after_plus : ] , netloc , newpath , query , fragment ) , ) if '://' not in url : assert 'file:' not in url url = url . replace ( 'git+' , 'git+ssh://' ) url , rev , user_pass = super ( ) . get_url_rev_and_auth ( url ) url = url . replace ( 'ssh://' , '' ) else : url , rev , user_pass = super ( ) . get_url_rev_and_auth ( url ) return url , rev , user_pass