List all contributors visible in the git history.
769580
def contributors(lancet, output):
    
    sorting = pygit2.GIT_SORT_TIME | pygit2.GIT_SORT_REVERSE
    commits = lancet.repo.walk(lancet.repo.head.target, sorting)
    contributors = ((c.author.name, c.author.email) for c in commits)
    contributors = OrderedDict(contributors)

    template_content = content_from_path(
        lancet.config.get('packaging', 'contributors_template'))
    template = Template(template_content)
    output.write(template.render(contributors=contributors).encode('utf-8'))
1042153
def sort(self):
        """"""
        self.sorted_commits = sorted(self.commits,
                                     key=lambda x: x.committer_time,
                                     reverse=True)
        return self.sorted_commits
964407
def collaborators(self):
        
        if self.api and self.collaborator_ids:
            return self.api._get_users(self.collaborator_ids)
297398
def contribution_breakdown():
    
    args = ['git', 'blame']
    counts = {}
    line_format = '{0:30}\t{1:>10}\t{2:>10}%'
    files = subprocess.check_output(['git', 'ls-files']).decode("utf-8").split('\n')

    for f in files[:-1]:
        if 'docs/latest' in f or '_themes' in f:
            continue  # skip generated stuff
        lines = subprocess.check_output(args + [f]).decode('utf-8')
        blames = [get_line_blame(line) for line in lines.split('\n')]
        for blame in blames:
            counts[blame] = counts.get(blame, 0) + 1

    total = sum([counts[count] for count in counts])
    contribs = [(user, counts[user]) for user in counts]
    contribs.sort(key=lambda x: x[1], reverse=True)

    print(line_format.format('User', 'Lines', 'Line '))

    for user in contribs:
        percent = floor(100.0 * user[1] / total)
        if percent == 0: percent = '>1'
        print(line_format.format(user[0], user[1], percent))

    print(line_format.format('Total', total, 100))
54431
def get_stats_contributors(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/stats/contributors"
        )
        if not data:
            return None
        else:
            return [
                github.StatsContributor.StatsContributor(self._requester, headers, attributes, completed=True)
                for attributes in data
            ]
798998
def author_list(self):
        ''' '''
        author_list = [self.submitter] + \
            [author for author in self.authors.all().exclude(pk=self.submitter.pk)]
        return ",\n".join([author.get_full_name() for author in author_list])
359457
def list_contributors(self, project_id=None, language_code=None):
        
        data = self._run(
            url_path="contributors/list",
            id=project_id,
            language=language_code
        )
        return data['result'].get('contributors', [])
642152
def list_repos(**kwargs):
    '''
    
    '''
    _check_apt()
    repos = {}
    sources = sourceslist.SourcesList()
    for source in sources.list:
        if _skip_source(source):
            continue
        repo = {}
        repo['file'] = source.file
        repo['comps'] = getattr(source, 'comps', [])
        repo['disabled'] = source.disabled
        repo['enabled'] = not repo['disabled']  # This is for compatibility with the other modules
        repo['dist'] = source.dist
        repo['type'] = source.type
        repo['uri'] = source.uri.rstrip('/')
        repo['line'] = salt.utils.pkg.deb.strip_uri(source.line.strip())
        repo['architectures'] = getattr(source, 'architectures', [])
        repos.setdefault(source.uri, []).append(repo)
    return repos
269384
public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null,
                                string $since = null, string $until = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([
                "sha"    => $sha,
                "path"   => $path,
                "author" => $author,
                "since"  => $since,
                "until"  => $until
            ])));
    }
678004
def _get_branches(self):
        """"""
        if self.offline:
            local_path = Path(LOCAL_PATH).expanduser() / self.org / self.repo
            get_refs = f"git -C {shlex.quote(str(local_path))} show-ref --heads"
        else:
            get_refs = f"git ls-remote --heads https://github.com/{self.org}/{self.repo}"
        try:
            # Parse get_refs output for the actual branch names
            return (line.split()[1].replace("refs/heads/", "") for line in _run(get_refs, timeout=3).split("\n"))
        except Error:
            return []
522811
def find_author(self):
        """"""
        return Author(name=self.context.capture('git', 'config', 'user.name', check=False, silent=True),
                      email=self.context.capture('git', 'config', 'user.email', check=False, silent=True))
135848
def get_all_repos(self):
        
        url = "https://api.github.com/user/repos"
        params = {
            "access_token": GITHUB_TOKEN
        }  # add auth params
        url = add_params_to_url(url, params)
        return self._get_repos(url)
328102
def generate_authors(git_dir):
    """"""
    authors = []
    emails = []
    git_log_cmd = ['git', 'log', '--format=%aN|%aE']
    tmp_authors = _run_shell_command(git_log_cmd, git_dir).split('\n')
    for author_str in tmp_authors:
        author, email = author_str.split('|')
        author = author.strip()
        email = email.strip()
        if author.lower() not in [x.lower() for x in authors]:
            if email.lower() not in [x.lower() for x in emails]:
                authors.append(author)
                emails.append(email)
    co_authors_raw = _run_shell_command(['git', 'log'], git_dir)
    co_authors = re.findall('Co-authored-by:.+', co_authors_raw,
                            re.MULTILINE)
    co_authors = [signed.split(":", 1)[1].strip().split('<')
                  for signed in co_authors if signed]
    for author_str in co_authors:
        author, email = author_str.split('<')
        author = author.strip()
        email = email[:-1].strip()
        if author.lower() not in [x.lower() for x in authors]:
            if email.lower() not in [x.lower() for x in emails]:
                authors.append(author)
                emails.append(email)
    authors = sorted(set(authors))
    return authors
1170477
def find_branches(self):
        """"""
        for prefix, name, revision_id in self.find_branches_raw():
            yield Revision(
                branch=name,
                repository=self,
                revision_id=revision_id,
            )
703817
def list_repos(owner=None, **kwargs):
    """"""
    client = get_repos_api()

    api_kwargs = {}
    api_kwargs.update(utils.get_page_kwargs(**kwargs))

    # pylint: disable=fixme
    # FIXME: Compatibility code until we work out how to conflate
    # the overlapping repos_list methods into one.
    repos_list = client.repos_list_with_http_info

    if owner is not None:
        api_kwargs["owner"] = owner
        if hasattr(client, "repos_list0_with_http_info"):
            # pylint: disable=no-member
            repos_list = client.repos_list0_with_http_info
    else:
        if hasattr(client, "repos_all_list_with_http_info"):
            # pylint: disable=no-member
            repos_list = client.repos_all_list_with_http_info

    with catch_raise_api_exception():
        res, _, headers = repos_list(**api_kwargs)

    ratelimits.maybe_rate_limit(client, headers)
    page_info = PageInfo.from_headers(headers)
    return [x.to_dict() for x in res], page_info
73619
def list_of_installed(self, repo, name):
        
        all_installed_names = []
        all_installed_packages = find_package("", self.meta.pkg_path)
        for inst in all_installed_packages:
            if repo == "sbo" and inst.endswith("_SBo"):
                name = split_package(inst)[0]
                all_installed_names.append(name)
            else:
                if name:
                    all_installed_names.append(split_package(inst)[0])
                else:
                    all_installed_names.append(inst)
        return all_installed_names
113326
def fetchall(self):
        """"""
        try:
            self.repo.remotes.origin.fetch()
        except git.exc.GitCommandError as err:
            raise GitError(err)