scraper/github/__init__.py
def connect(url='https://github.com', token=None):
    """
    Create a GitHub session for making requests
    """

    gh_session = None
    if url == 'https://github.com':
        gh_session = create_session(token)
    else:
        gh_session = create_enterprise_session(url, token)

    if gh_session is None:
        msg = 'Unable to connect to (%s) with provided token.'
        raise RuntimeError(msg, url)

    logger.info('Connected to: %s', url)

    return gh_session
def connect(url='https://github.com', token=None):
    gh_session = None
    if url == 'https://github.com':
        gh_session = create_session(token)
    else:
        gh_session = create_enterprise_session(url, token)

    if gh_session is None:
        msg = 'Unable to connect to (%s) with provided token.'
        raise RuntimeError(msg, url)

    logger.info('Connected to: %s', url)

    return gh_session
def connect ( url = 'https://github.com' , token = None ) : gh_session = None if url == 'https://github.com' : gh_session = create_session ( token ) else : gh_session = create_enterprise_session ( url , token ) if gh_session is None : msg = 'Unable to connect to (%s) with provided token.' raise RuntimeError ( msg , url ) logger . info ( 'Connected to: %s' , url ) return gh_session
Create a GitHub session for making requests
Create a GitHub session for making requests