(
    *, user_id: int, login: str, name: Optional[str], type: str
)
return f"Co-authored-by: {display_name} <{author_email}>"
Build a coauthor trailer given user information.
Build a coauthor trailer given user information.
Build a coauthor trailer given user information .
def get_coauthor_trailer(
    *, user_id: int, login: str, name: Optional[str], type: str
) -> str:
    """
    Build a coauthor trailer given user information.
    """
    display_name = login
    display_login = login
    if type == "Bot":
        # the GitHub GraphQL API returns bot names without the `[bot]` suffix.
        display_name += "[bot]"
        display_login += "[bot]"
    if name:
        display_name = name

    # GitHub does not allow our GitHub App to view the email addresses of
    # pull request authors, so we generate a noreply GitHub email address
    # instead which works the same for the GitHub UI.
    author_email = f"{user_id}+{display_login}@users.noreply.github.com"
    return f"Co-authored-by: {display_name} <{author_email}>"
def get_coauthor_trailer ( * , user_id : int , login : str , name : Optional [ str ] , type : str ) -> str : display_name = login display_login = login if type == "Bot" : # the GitHub GraphQL API returns bot names without the `[bot]` suffix. display_name += "[bot]" display_login += "[bot]" if name : display_name = name # GitHub does not allow our GitHub App to view the email addresses of # pull request authors, so we generate a noreply GitHub email address # instead which works the same for the GitHub UI. author_email = f"{user_id}+{display_login}@users.noreply.github.com" return f"Co-authored-by: {display_name} <{author_email}>"