Gets repos in url

        :param url: Url
        :return: List of repositories in given url
544870
def _get_repos(url):
        
        current_page = 1
        there_is_something_left = True
        repos_list = []

        while there_is_something_left:
            api_driver = GithubRawApi(
                url,
                url_params={"page": current_page},
                get_api_content_now=True
            )  # driver to parse API content

            for repo in api_driver.api_content:  # list of raw repository
                repo_name = repo["name"]
                repo_user = repo["owner"]["login"]
                repos_list.append(
                    GithubUserRepository(repo_user, repo_name))

            there_is_something_left = bool(api_driver.api_content)
            current_page += 1

        return repos_list
495636
def clone_repo(session, urls):
    
    repos = []
    for url in urls:
        dir = mkdtemp()
        call = ["git", "clone", url, dir]
        subprocess.call(call)
        repos.append((dir, url))
    return repos
1051155
def gather_repositories():
    

    for (root, dirs, files) in os.walk('.', topdown=True):
        if '.git' not in dirs:
            continue

        for dir in list(dirs):
            dirs.remove(dir)

        path = os.path.split(root)[1]
        repo = os.path.basename(path)
        yield (repo, root)
1249534
def _repo_list(self, args):
        '''
        
        '''
        repo_metadata = self._get_repo_metadata()
        for repo in repo_metadata:
            self.ui.status(repo)
198016
def fetch(self, url):
        
        url = self._get_url(url)
        so, se = self.run_git_command('ls-remote -h %s' % url)
        refs = []
        for line in (x for x in so.splitlines()):
            sha, ref = line.split('\t')
            refs.append(ref)
        refs = ' '.join(('+%s:%s' % (r, r) for r in refs))
        cmd = '''fetch %s -- %s''' % (url, refs)
        self.run_git_command(cmd)
905559
def _fix_repo_url(repo_url):
    """"""
    parsed = urlparse.urlparse(repo_url)
    
    if parsed.scheme not in ('http', 'https'):
        # Fix only for http and https.
        return repo_url

    username = parsed.username or ""
    password = parsed.password or ""
    port = ":" + parsed.port if parsed.port else ""
    netloc = "".join((username, ":", password, "@", parsed.hostname, port))
    part_list = list(parsed)
    part_list[1] = netloc
    return urlparse.urlunparse(part_list)
641460
def get_arthur_params_from_url(cls, url):
        # In the url the org and the repository are included

        params = url.split()
        
        params = {"owner": params[0], "repository": params[1]}

        return params
245876
def find_repo_urls(session, name, candidates):
    
    for _url in candidates:
        if validate_url(_url):
            try:
                resp = session.get(_url)
                if resp.status_code == 200:
                    tree = etree.HTML(resp.content)
                    if tree:
                        for link in frozenset([str(l) for l in tree.xpath("//a/@href")]):
                            # check if the link 1) is to github.com / bitbucket.org AND 2) somewhat
                            # contains the project name
                            if ("github.com" in link or "bitbucket.org" in link or
                                    "sourceforge.net" in link) \
                                    and contains_project_name(name, link):
                                link = validate_url(validate_repo_url(url=link))
                                if link:
                                    logger.debug("Found repo URL {}".format(link))
                                    yield link
            except ConnectionError:
                # we really don't care about connection errors here. a lot of project pages are simply
                # down because the project is no longer maintained
                pass
            except etree.XMLSyntaxError:
                # unable to parse HTML
                pass
            except UnicodeEncodeError:
                pass
1097804
def get_arthur_params_from_url(cls, url):
        
        params = {}

        owner = url.split('/')[-2]
        repository = url.split('/')[-1]
        # params.append('--owner')
        params['owner'] = owner
        # params.append('--repository')
        params['repository'] = repository
        return params
924580
def get_keys(self):
        
        return github.PaginatedList.PaginatedList(
            github.RepositoryKey.RepositoryKey,
            self._requester,
            self.url + "/keys",
            None
        )
1145007
def validate_repo_url(url):
    
    try:
        if "github.com" in url:
            return re.findall(r"https?://w?w?w?.?github.com/[\w\-]+/[\w.-]+", url)[0]
        elif "bitbucket.org" in url:
            return re.findall(r"https?://bitbucket.org/[\w.-]+/[\w.-]+", url)[0] + "/src/"
        elif "launchpad.net" in url:
            return re.findall(r"https?://launchpad.net/[\w.-]+", url)[0]
        elif "sourceforge.net" in url:
            mo = re.match(r"https?://sourceforge.net/projects/"
                          r"([\w.-]+)/", url, re.I)
            template = "https://sourceforge.net/p/{}/code/HEAD/tree/trunk/src/"
            return template.format(mo.groups()[0])
    except (IndexError, AttributeError):
        pass
    return ""
237074
def _get_configured_repos(root=None):
    '''
    
    '''

    repos = os.path.join(root, os.path.relpath(REPOS, os.path.sep)) if root else REPOS
    repos_cfg = configparser.ConfigParser()
    if os.path.exists(repos):
        repos_cfg.read([repos + '/' + fname for fname in os.listdir(repos) if fname.endswith(".repo")])
    else:
        log.warning('Repositories not found in %s', repos)

    return repos_cfg
1169275
def get_pull_requests(self):
        ""
        g = self.github
        query = {'state': 'all'}
        if self.args.github_token:
            query['access_token'] = g['token']

        def f(pull):
            if self.args.ignore_closed:
                return (pull['state'] == 'opened' or
                        (pull['state'] == 'closed' and pull['merged_at']))
            else:
                return True
        pulls = filter(f,
                       self.get(g['url'] + "/repos/" + g['repo'] + "/pulls",
                                query, self.args.cache))
        return dict([(str(pull['number']), pull) for pull in pulls])
1261850
def list_repo(self):
        
        req = proto.ListRepoRequest()
        res = self.stub.ListRepo(req, metadata=self.metadata)
        if hasattr(res, 'repo_info'):
            return res.repo_info
        return []
970026
def get_arthur_params_from_url(cls, url):
        
        params = {}

        args = cls.get_perceval_params_from_url(url)
        parser = GitLabCommand.setup_cmd_parser()

        parsed_args = parser.parse(*args)

        params['owner'] = parsed_args.owner
        params['repository'] = parsed_args.repository
        # include only blacklist ids information
        params['blacklist_ids'] = parsed_args.blacklist_ids

        return params
802179
def has_in_repos(self, repo):
        
        assert isinstance(repo, github.Repository.Repository), repo
        status, headers, data = self._requester.requestJson(
            "GET",
            self.url + "/repos/" + repo._identity
        )
        return status == 204
381353
def all(self):
        
        url = self.bitbucket.url('GET_USER', username=self.bitbucket.username)
        response = self.bitbucket.dispatch('GET', url, auth=self.bitbucket.auth)
        try:
            return (response[0], response[1]['repositories'])
        except TypeError:
            pass
        return response