def METHOD_NAME(payload):
    """Return serializer instance based on a request and event type."""
    if 'X-Gitlab-Event' in payload.keys():
        return gitlab_event_to_serializer.get(payload['X-Gitlab-Event'])
    elif 'X-Github-Event' in payload.keys():
        return github_event_to_serializer.get(payload['X-Github-Event'])
    return None