Retrieves the authors list, from the AUTHORS file (if in a package) or
    generates it from the git history.

    Returns:
        list(str): List of authors

    Raises:
        RuntimeError: If the authors could not be retrieved
346864
def get_authors(project_dir=os.curdir):
    
    authors = set()
    pkg_info_file = os.path.join(project_dir, 'PKG-INFO')
    authors_file = os.path.join(project_dir, 'AUTHORS')
    if os.path.exists(pkg_info_file) and os.path.exists(authors_file):
        with open(authors_file) as authors_fd:
            authors = set(authors_fd.read().splitlines())
    else:
        authors = api.get_authors(repo_path=project_dir)

    return authors
524362
def compile_authors(authors):
    
    author_list = []
    for person in authors:
        author_list.append({'name': person['family'] + ", " + person['given']})
    return author_list
1338195
def authors(self, *usernames):
        
        if len(usernames) == 1:
            return self.filter(**{"author__{}".format(User.USERNAME_FIELD): usernames[0]})
        else:
            return self.filter(**{"author__{}__in".format(User.USERNAME_FIELD): usernames})
46979
def get_authors(repo_path, from_commit):
    
    repo = dulwich.repo.Repo(repo_path)
    refs = get_refs(repo)
    start_including = False
    authors = set()

    if from_commit is None:
        start_including = True

    for commit_sha, children in reversed(
        get_children_per_first_parent(repo_path).items()
    ):
        commit = get_repo_object(repo, commit_sha)
        if (
            start_including or commit_sha.startswith(from_commit) or
            fuzzy_matches_refs(from_commit, refs.get(commit_sha, []))
        ):
            authors.add(commit.author.decode())
            for child in children:
                authors.add(child.author.decode())

            start_including = True

    return '\n'.join(sorted(authors))
13893
def _extract_authors(pub, idx, _root):
    
    logger_ts.info("enter extract_authors")
    try:
        # DOI Author data. We'd prefer to have this first.
        names = pub['author']
    except KeyError as e:
        try:
            # Manually entered author data. This is second best.
            names = pub['authors']
        except KeyError as e:
            # Couldn't find any author data. Skip it altogether.
            names = False
            logger_ts.info("extract_authors: KeyError: author data not provided, {}".format(e))

    # If there is author data, find out what type it is
    if names:
        # Build author names onto empty string
        auth = ''
        # Is it a list of dicts or a list of strings? Could be either
        # Authors: Stored as a list of dictionaries or list of strings
        if isinstance(names, list):
            for name in names:
                if isinstance(name, str):
                    auth += name + ';'
                elif isinstance(name, dict):
                    for k, v in name.items():
                        auth += v + ';'
        elif isinstance(names, str):
            auth = names
        # Enter finished author string into target
        _root['pub' + str(idx + 1) + '_author'] = auth[:-1]
    return _root
547138
def source(self):
        
        if len(self.sources) == 0:
            raise ValueError("No source associated with %s" % self.__class__.__name__)
        elif len(self.sources) > 1:
            raise ValueError("Multiple sources for %s" % self.__class__.__name__)
        return list(self.sources)[0]
988570
def get_author(self):
        
        author = self.commit.author

        out = ""
        if author.name is not None:
            out += author.name

        if author.email is not None:
            out += " (" + author.email + ")"

        return out
906697
def get_collaborators(self, affiliation=github.GithubObject.NotSet):
        

        url_parameters = dict()
        allowed_affiliations = ['outside', 'direct', 'all']
        if affiliation is not github.GithubObject.NotSet:
            assert isinstance(affiliation, str), affiliation
            assert affiliation in allowed_affiliations, \
                'Affiliation can be one of ' + ', '.join(allowed_affiliations)
            url_parameters['affiliation'] = affiliation

        return github.PaginatedList.PaginatedList(
            github.NamedUser.NamedUser,
            self._requester,
            self.url + "/collaborators",
            url_parameters
        )
1176292
def get_authors(self):
        
        if self._authors is None:
            # Sort messages with date first (by date ascending), and those
            # without a date last.
            msgs = sorted(self.get_messages().keys(),
                          key=lambda m: m.get_date() or datetime.max)

            orderby = settings.get('thread_authors_order_by')
            self._authors = []
            if orderby == 'latest_message':
                for m in msgs:
                    pair = m.get_author()
                    if pair in self._authors:
                        self._authors.remove(pair)
                    self._authors.append(pair)
            else:  # i.e. first_message
                for m in msgs:
                    pair = m.get_author()
                    if pair not in self._authors:
                        self._authors.append(pair)

        return self._authors
355912
private function getAuthorListFrom()
    {
        $filePath = $this->getFilePathCollection($this->currentPath);

        $authors = [];
        foreach ((array) $filePath['commits'] as $commit) {
            if ($this->isMergeCommit($commit)
                || isset($authors[\md5($commit['name'])])
            ) {
                continue;
            }

            $authors[\md5($commit['name'])] = $commit;
        }

        if (isset($filePath['pathHistory'])) {
            foreach ((array) $filePath['pathHistory'] as $pathHistory) {
                foreach ((array) $pathHistory['commits'] as $commitHistory) {
                    if ($this->isMergeCommit($commitHistory)
                        || isset($authors[\md5($commitHistory['name'])])
                    ) {
                        continue;
                    }

                    $authors[\md5($commitHistory['name'])] = $commitHistory;
                }
            }
        }

        return $authors;
    }
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
630272
public function getAuthors()
    {
        if (is_array($this->_authors)) return $this->_authors;
        $this->_authors = array();
        if(!isset($this->_packageXml->authors->author)) {
            return array();
        }
        foreach ($this->_packageXml->authors->author as $_author) {
            $this->_authors[] = array(
                'name' => (string)$_author->name,
                'user' => (string)$_author->user,
                'email'=> (string)$_author->email
            );
        }
        return $this->_authors;
    }
136740
def list_authors():
    """"""
    authors = Author.query.all()
    content = '<p>Authors:</p>'
    for author in authors:
        content += '<p>%s</p>' % author.name
    return content
158431
def get_dict(self):
        
        return {
            'authors': self.authors,
            'date_download': self.date_download,
            'date_modify': self.date_modify,
            'date_publish': self.date_publish,
            'description': self.description,
            'filename': self.filename,
            'image_url': self.image_url,
            'language': self.language,
            'localpath': self.localpath,
            'source_domain': self.source_domain,
            'text': self.text,
            'title': self.title,
            'title_page': self.title_page,
            'title_rss': self.title_rss,
            'url': self.url
        }
908253
def to_json(self):
        
        return json.dumps({
            "statistics": self.get_statistics()
            , "authors": [json.loads(author.to_json()) for author in self.get_authors()]
        }, indent=2)
46052
def get_subscriptions(self):
        
        return github.PaginatedList.PaginatedList(
            github.Repository.Repository,
            self._requester,
            self.url + "/subscriptions",
            None
        )
1282017
def get_starred_repos(self):
        
        starred_url = self.api_url + "/starred"
        keep_finding = True  # False when there are no more stars to find
        current_page = 1
        repos_list = []

        while keep_finding:
            api_url = starred_url + "?page=" + str(
                current_page)  # request starred list url with page number
            api_driver = GithubRawApi(
                api_url,
                True
            )  # driver to parse API content
            for repo in api_driver:
                repo_username = repo["owner"]["login"]
                repo_name = repo["name"]
                repos_list.append(
                    GithubUserRepository(repo_username, repo_name))

            if len(api_driver.api_content) < 1:  # no more repo to find
                keep_finding = False
            current_page += 1  # increase page counter

        return repos_list