def authenticate(flow, storage=None):
    http = httplib2.Http()

    # Prepare credentials, and authorize HTTP object with them.
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = tools.run(flow, storage)

    http = credentials.authorize(http)
    return http
Try to retrieve a valid set of credentials from the token store if possible
dataset/ETHPy150Open pydata/pandas/pandas/io/auth.py/authenticate