<commit_before>package com.google.cloud.android.speech;

import android.os.AsyncTask;

import org.json.JSONObject;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import cz.msebera.android.httpclient.HttpResponse;
import cz.msebera.android.httpclient.client.ClientProtocolException;
import cz.msebera.android.httpclient.client.HttpClient;
import cz.msebera.android.httpclient.client.ResponseHandler;
import cz.msebera.android.httpclient.client.methods.HttpPost;
import cz.msebera.android.httpclient.entity.StringEntity;
import cz.msebera.android.httpclient.impl.client.BasicResponseHandler;
import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;


/**
 * Created by pauboix on 19/07/2017.
 */

public class BobTheBuilder extends AsyncTask<Void, Void, Void> {

    private JSONObject json;
    public String body;
    public BobTheBuilder(JSONObject json) {
        this.json = json;
    }


    @Override
    protected Void doInBackground(Void... voids) {
        HttpClient httpclient = new DefaultHttpClient();
        String bobTheBuilderPath = "https://api.typeform.com/forms";
        try {
            StringEntity entityPayload = new StringEntity(json.toString());
            HttpPost httpost = new HttpPost(bobTheBuilderPath);

            httpost.setEntity(entityPayload);
            httpost.setHeader("Accept", "application/json");
            httpost.setHeader("Content-type", "application/json");
            httpost.setHeader("Authorization", "Bearer gozpRNgNbuPm9POrj9M3RGdFFKqaVEivI48F1PE5--0=");

            ResponseHandler<String> responseHandler = new BasicResponseHandler();
            HttpResponse response = httpclient.execute(httpost);
            body = responseHandler.handleResponse(response);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();<commit_msg>last challenge commit<commit_after>package com.google.cloud.android.speech;

import android.os.AsyncTask;

import org.json.JSONObject;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import cz.msebera.android.httpclient.HttpResponse;
import cz.msebera.android.httpclient.client.ClientProtocolException;
import cz.msebera.android.httpclient.client.HttpClient;
import cz.msebera.android.httpclient.client.ResponseHandler;
import cz.msebera.android.httpclient.client.methods.HttpPost;
import cz.msebera.android.httpclient.entity.StringEntity;
import cz.msebera.android.httpclient.impl.client.BasicResponseHandler;
import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;


/**
 * Created by pauboix on 19/07/2017.
 */

public class BobTheBuilder extends AsyncTask<Void, Void, Void> {

    private JSONObject json;
    public String body;
    public BobTheBuilder(JSONObject json) {
        this.json = json;
    }


    @Override
    protected Void doInBackground(Void... voids) {
        HttpClient httpclient = new DefaultHttpClient();
        String bobTheBuilderPath = "https://api.typeform.com/forms";
        try {
            StringEntity entityPayload = new StringEntity(json.toString());
            HttpPost httpost = new HttpPost(bobTheBuilderPath);

            httpost.setEntity(entityPayload);
            httpost.setHeader("Accept", "application/json");
            httpost.setHeader("Content-type", "application/json");
            httpost.setHeader("Authorization", "<uthorization>");

            ResponseHandler<String> responseHandler = new BasicResponseHandler();
            HttpResponse response = httpclient.execute(httpost);
            body = responseHandler.handleResponse(response);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
{'fraction_non_alphanumeric': 0.10178436793164111, 'fraction_numerical': 0.006031666247800955, 'mean_word_length': 3.512471655328798, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2563755', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1098, 'n_words': 198}