(
    *,
    coauthors: List[PullRequestCommitUser],
    include_pull_request_author: bool,
    pull_request_author_id: int,
)
return coauthor_trailers
Deduplicate coauthors and convert to strings.
Deduplicate coauthors and convert to strings.
Deduplicate coauthors and convert to strings .
def get_coauthor_trailers(
    *,
    coauthors: List[PullRequestCommitUser],
    include_pull_request_author: bool,
    pull_request_author_id: int,
) -> List[str]:
    """
    Deduplicate coauthors and convert to strings.
    """
    coauthor_trailers = []
    deduped_coauthors: Dict[PullRequestCommitUser, bool] = {}
    for dupe_coauthor in coauthors:
        deduped_coauthors[dupe_coauthor] = True

    for coauthor in deduped_coauthors:
        if coauthor.databaseId is None:
            continue
        if (
            not include_pull_request_author
            and coauthor.databaseId == pull_request_author_id
        ):
            continue

        coauthor_trailers.append(
            get_coauthor_trailer(
                user_id=coauthor.databaseId,
                login=coauthor.login,
                name=coauthor.name,
                type=coauthor.type,
            )
        )
    return coauthor_trailers
def get_coauthor_trailers ( * , coauthors : List [ PullRequestCommitUser ] , include_pull_request_author : bool , pull_request_author_id : int , ) -> List [ str ] : coauthor_trailers = [ ] deduped_coauthors : Dict [ PullRequestCommitUser , bool ] = { } for dupe_coauthor in coauthors : deduped_coauthors [ dupe_coauthor ] = True for coauthor in deduped_coauthors : if coauthor . databaseId is None : continue if ( not include_pull_request_author and coauthor . databaseId == pull_request_author_id ) : continue coauthor_trailers . append ( get_coauthor_trailer ( user_id = coauthor . databaseId , login = coauthor . login , name = coauthor . name , type = coauthor . type , ) ) return coauthor_trailers