<commit_before>import pdb
import time
import requests
from requests_oauthlib import OAuth1
from urlparse import parse_qs
import webbrowser

class OAuth(object):

    BASE_URL = "http://query.yahooapis.com/v1/yql"
    REQUEST_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/get_request_token"
    ACCESS_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/get_token"
    AUTHORIZE_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token="
    CALLBACK_URI = 'oob'

    def __init__(self, ck=None, cs=None):
        """
        """
        self.ck='<KEY>'
        self.cs='08802b459ab48eeaca765c119b0af6a4b75789f7'
        self.oauth = OAuth1(self.ck, client_secret=self.cs, callback_uri=self.CALLBACK_URI)
        
    def request_token(self,):
        """
        """
        response = requests.post(url=self.REQUEST_TOKEN_URL, auth=self.oauth)
        credentias = parse_qs(response.content)
        self.request_token = credentias.get('oauth_token')[0]
        self.request_token_secret = credentias.get('oauth_token_secret')[0]
        print(self.request_token, self.request_token_secret) 
        return self.request_token, self.request_token_secret
        
    def get_user_authorization(self,):
        """
        """
        webbrowser.open(self.AUTHORIZE_TOKEN_URL+self.request_token)
        self.verifier = raw_input("Please input a verifier: ")
        print(self.verifier)
    

if '__main__' == __name__:

    auth = OAuth()
    auth.request_token()
    auth.get_user_authorization()

<commit_msg>you know wy<commit_after>import pdb
import time
import requests
from requests_oauthlib import OAuth1
from urlparse import parse_qs
import webbrowser
import credentials

class OAuth(object):

    BASE_URL = "http://query.yahooapis.com/v1/yql"
    REQUEST_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/get_request_token"
    ACCESS_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/get_token"
    AUTHORIZE_TOKEN_URL = "https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token="
    CALLBACK_URI = 'oob'

    def __init__(self, ck=None, cs=None):
        """
        """
        self.ck = credentials.ck
        self.cs = credentials.cs
        self.oauth = OAuth1(self.ck, client_secret=self.cs, callback_uri=self.CALLBACK_URI)
        
    def request_token(self,):
        """
        """
        response = requests.post(url=self.REQUEST_TOKEN_URL, auth=self.oauth)
        credentias = parse_qs(response.content)
        self.request_token = credentias.get('oauth_token')[0]
        self.request_token_secret = credentias.get('oauth_token_secret')[0]
        print(self.request_token, self.request_token_secret) 
        return self.request_token, self.request_token_secret
        
    def get_user_authorization(self,):
        """
        """
        webbrowser.open(self.AUTHORIZE_TOKEN_URL+self.request_token)
        self.verifier = raw_input("Please input a verifier: ")
        print(self.verifier)
    

if '__main__' == __name__:

    auth = OAuth()
    auth.request_token()
    auth.get_user_authorization()


{'fraction_non_alphanumeric': 0.11618798955613577, 'fraction_numerical': 0.013381201044386422, 'mean_word_length': 3.1587516960651287, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 6, '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': '3926739', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1046, 'n_words': 146}