scraper/github/__init__.py
def create_session(token=None):
    """
    Create a github3.py session connected to GitHub.com

    If token is not provided, will attempt to use the GITHUB_API_TOKEN
    environment variable if present.
    """
    if token is None:
        token = os.environ.get('GITHUB_API_TOKEN', None)

    gh_session = github3.login(token=token)

    if gh_session is None:
        raise RuntimeError('Invalid or missing GITHUB_API_TOKEN')

    return gh_session
def create_session(token=None):
    """
    Create a github3.py session connected to GitHub.com

    If token is not provided, will attempt to use the GITHUB_API_TOKEN
    environment variable if present.
    """
    if token is None:
        token = os.environ.get('GITHUB_API_TOKEN', None)

    gh_session = github3.login(token=token)

    if gh_session is None:
        raise RuntimeError('Invalid or missing GITHUB_API_TOKEN')

    return gh_session
Create a github3.py session connected to GitHub.com

    If token is not provided, will attempt to use the GITHUB_API_TOKEN
    environment variable if present.