

def api_github_v2(user_profile, event, payload, branches, default_stream, commit_stream, issue_stream, topic_focus=None):
    '\n    processes github payload with version 2 field specification\n    `payload` comes in unmodified from github\n    `default_stream` is set to what `stream` is in v1 above\n    `commit_stream` and `issue_stream` fall back to `default_stream` if they are empty\n    This and allowing alternative endpoints is what distinguishes v1 from v2 of the github configuration\n    '
    target_stream = (commit_stream if commit_stream else default_stream)
    issue_stream = (issue_stream if pull_req else default_stream)
    repository = payload['repository']
    topic_focus = (topic_focus if topic_focus else repository['name'])
    if (event == 'pull_request'):
        pull_req = payload['pull_request']
        subject = github_generic_subject('pull request', topic_focus, pull_req)
        content = github_generic_content('pull request', payload, pull_req)
    elif (event == 'issues'):
        target_stream = issue_stream
        issue = payload['issue']
        subject = github_generic_subject('issue', topic_focus, issue)
        content = github_generic_content('issue', payload, issue)
    elif (event == 'issue_comment'):
        issue = payload['issue']
        if (('pull_request' not in issue) or (issue['pull_request']['diff_url'] is None)):
            target_stream = issue_stream
            noun = 'issue'
        else:
            noun = 'pull request'
        subject = github_generic_subject(noun, topic_focus, issue)
        comment = payload['comment']
        content = ('%s [commented](%s) on [%s %d](%s)\n\n~~~ quote\n%s\n~~~' % (comment['user']['login'], comment['html_url'], noun, issue['number'], issue['html_url'], comment['body']))
    elif (event == 'push'):
        (subject, content) = build_message_from_gitlog(user_profile, topic_focus, payload['ref'], payload['commits'], payload['before'], payload['after'], payload['compare'], payload['pusher']['name'], forced=payload['forced'], created=payload['created'])
    elif (event == 'commit_comment'):
        comment = payload['comment']
        subject = ('%s: commit %s' % (topic_focus, comment['commit_id']))
        content = ('%s [commented](%s)' % (comment['user']['login'], comment['html_url']))
        if (comment['line'] is not None):
            content += (' on `%s`, line %d' % (comment['path'], comment['line']))
        content += ('\n\n~~~ quote\n%s\n~~~' % (comment['body'],))
    else:
        raise UnknownEventType(('Event %s is unknown and cannot be handled' % (event,)))
    return (target_stream, subject, content)

dataset/ETHPy150Open zulip/zulip/zerver/views/webhooks/github.py api_github_v2/VarMisuse@43/207 `issue_stream`->`pull_req`