<commit_before>import odesk

PUBLIC_KEY = None
SECRET_KEY = None

PUBLIC_KEY = '<KEY>'
SECRET_KEY = '3fa4d68bbde53c83'


#TODO: Desktop app example (check if it's working at all - wasn't last time)

def time_reports(public_key, secret_key):
    print "Emulating web-based app"
    #Instantiating a client without an auth token
    client = odesk.Client(public_key, secret_key)
    print "Please to this URL (authorize the app if necessary):"
    print client.auth.auth_url()
    print "After that you should be redirected back to your app URL with " + \
          "additional ?frob= parameter"
    frob = raw_input('Enter frob: ') 
    auth_token, user = client.auth.get_token(frob)
    print "Authenticated user:"
    print user
    #Instantiating a new client, now with a token. 
    #Not strictly necessary here (could just set `client.auth_token`), but 
    #typical for web apps, which wouldn't probably keep client instances 
    #between requests
    client = odesk.Client(public_key, secret_key, auth_token)
    print client.time_reports.get_provider_report('vhotsyk', ['worked_on', <commit_msg>Changed username in example to sample user<commit_after>import odesk

PUBLIC_KEY = None
SECRET_KEY = None

PUBLIC_KEY = '<KEY>'
SECRET_KEY = '3fa4d68bbde53c83'


#TODO: Desktop app example (check if it's working at all - wasn't last time)

def time_reports(public_key, secret_key):
    print "Emulating web-based app"
    #Instantiating a client without an auth token
    client = odesk.Client(public_key, secret_key)
    print "Please to this URL (authorize the app if necessary):"
    print client.auth.auth_url()
    print "After that you should be redirected back to your app URL with " + \
          "additional ?frob= parameter"
    frob = raw_input('Enter frob: ') 
    auth_token, user = client.auth.get_token(frob)
    print "Authenticated user:"
    print user
    #Instantiating a new client, now with a token. 
    #Not strictly necessary here (could just set `client.auth_token`), but 
    #typical for web apps, which wouldn't probably keep client instances 
    #between requests
    client = odesk.Client(public_key, secret_key, auth_token)
    print client.time_reports.get_provider_report('user2', ['worked_on', 
{'fraction_non_alphanumeric': 0.08508732646663682, 'fraction_numerical': 0.00761307657859382, 'mean_word_length': 3.9098901098901098, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '7125168', 'n_tokens_mistral': 732, 'n_tokens_neox': 690, 'n_words': 236}