<commit_before>import base64
import hashlib
import hmac
import json
import requests


def app_authentication(auth_code, app_id, app_secret, redirect_uri):
    """
    Returns an access token
    """
    response = requests.get("https://graph.facebook.com/oauth/access_token", {
        "client_id": app_id,
        "client_secret": app_secret,
        "code": auth_code,
        "redirect_uri": redirect_uri
    })
    
    return json.loads(response.content)["access_token"][-1]
<commit_msg>parse qs not json<commit_after>import base64
import cgi
import hashlib
import hmac
import json
import requests


def app_authentication(auth_code, app_id, app_secret, redirect_uri):
    """
    Returns an access token
    """
    response = requests.get("https://graph.facebook.com/oauth/access_token", {
        "client_id": app_id,
        "client_secret": app_secret,
        "code": auth_code,
        "redirect_uri": redirect_uri
    })
    
    access_token = cgi.parse_qs(response.content)["access_token"][-1]
    
    return access_token

{'fraction_non_alphanumeric': 0.11078998073217726, 'fraction_numerical': 0.005780346820809248, 'mean_word_length': 3.402542372881356, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6091803', 'n_tokens_mistral': 329, 'n_tokens_neox': 327, 'n_words': 69}