

def authenticate():
    config = get_config()
    config.read('auth.ini')
    client_id = config.get('credentials', 'client_id')
    client_secret = config.get('credentials', 'client_secret')
    client = ImgurClient(client_id, client_secret)
    authorization_url = client.get_auth_url('pin')
    print('Go to the following URL: {0}'.format(authorization_url))
    pin = get_input('Enter pin code: ')
    credentials = client.authorize(pin, 'pin')
    client.set_user_auth(credentials['access_token'], credentials['refresh_token'])
    print('Authentication successful! Here are the details:')
    print('   Access token:  {0}'.format(credentials['access_token']))
    print('   Refresh token: {0}'.format(credentials['refresh_token']))
    return client

dataset/ETHPy150Open Imgur/imgurpython/examples/auth.py authenticate/original