<commit_before>package it.growbit.matlab;

import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
import com.google.api.client.http.*;
import com.google.api.client.http.json.JsonHttpContent;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.json.gson.GsonFactory;
import it.growbit.matlab.model.Last24HoursAvg;
import it.growbit.matlab.model.Next24HourAvg;
import org.apache.http.client.utils.URIBuilder;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Logger;

/**
 * Created by name on 26/06/17.
 */
public class Matlab {

    private static final Logger log = Logger.getLogger(Matlab.class.getName());

    static final HttpTransport HTTP_TRANSPORT = new UrlFetchTransport();
    static final JsonFactory JSON_FACTORY = new GsonFactory();

    public static final Next24HourAvg criptoOracleValori(Last24HoursAvg matlab_model) throws URISyntaxException, IOException {

        URIBuilder uri_template = new URIBuilder()
                .setScheme("https")
                .setHost("matlab-dot-growbit-0.appspot.com")
                .setPath("/matlab/criptoOracleValori");

        URI uri = uri_template.build();
        GenericUrl generic_url = new GenericUrl(uri);

        HttpContent request_payload = new JsonHttpContent(JSON_FACTORY, matlab_model);

        HttpRequestFactory requestFactory =
                HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {
                    @Override
                    public void initialize(HttpRequest request) {
                        request.setParser(new JsonObjectParser(JSON_FACTORY));
                    }
                });

        HttpRequest request = requestFactory.buildPostRequest(generic_url, request_payload);


        Next24HourAvg forecast = request.execute().parseAs(Next24HourAvg.class);

        return forecast;
    }

    public static final Next24HourAvg superCriptoOracleTrend(Last24HoursAvg matlab_model) throws URISyntaxException, IOException {

        URIBuilder uri_template = new URIBuilder()
                .setScheme("https")
                .setHost("matlab-dot-growbit-0.appspot.com")
                .setPath("/matlab/superCriptoOracleTrend");

        URI uri = uri_template.build();
        GenericUrl generic_url = new GenericUrl(uri);

        HttpContent request_payload = new JsonHttpContent(JSON_FACTORY, matlab_model);

        HttpRequestFactory requestFactory =
                HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {
                    @Override
                    public void initialize(HttpRequest request) {
                        request.setParser(new JsonObjectParser(JSON_FACTORY));
                    }
                });

        HttpRequest request = requestFactory.buildPostRequest(generic_url, request_payload);


        Next24HourAvg forecast = request.execute().parseAs(Next24HourAvg.class);

        return forecast;<commit_msg>using generics invocation<commit_after>package it.growbit.matlab;

import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
import com.google.api.client.http.*;
import com.google.api.client.http.json.JsonHttpContent;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.json.gson.GsonFactory;
import it.growbit.matlab.model.Last24HoursAvg;
import it.growbit.matlab.model.Next24HourAvg;
import org.apache.http.client.utils.URIBuilder;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Logger;

/**
 * Created by name on 26/06/17.
 */
public class Matlab {

    private static final Logger log = Logger.getLogger(Matlab.class.getName());

    static final HttpTransport HTTP_TRANSPORT = new UrlFetchTransport();
    static final JsonFactory JSON_FACTORY = new GsonFactory();

    public static final Next24HourAvg criptoOracleValori(Last24HoursAvg matlab_model) throws URISyntaxException, IOException {

        URIBuilder uri_template = new URIBuilder()
                .setScheme("https")
                .setHost("matlab-dot-growbit-0.appspot.com")
                .setPath("/matlab/criptoOracleValori/criptoOracleValori");

        URI uri = uri_template.build();
        GenericUrl generic_url = new GenericUrl(uri);

        HttpContent request_payload = new JsonHttpContent(JSON_FACTORY, matlab_model);

        HttpRequestFactory requestFactory =
                HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {
                    @Override
                    public void initialize(HttpRequest request) {
                        request.setParser(new JsonObjectParser(JSON_FACTORY));
                    }
                });

        HttpRequest request = requestFactory.buildPostRequest(generic_url, request_payload);


        Next24HourAvg forecast = request.execute().parseAs(Next24HourAvg.class);

        return forecast;
    }

    public static final Next24HourAvg superCriptoOracleTrend(Last24HoursAvg matlab_model) throws URISyntaxException, IOException {

        URIBuilder uri_template = new URIBuilder()
                .setScheme("https")
                .setHost("matlab-dot-growbit-0.appspot.com")
                .setPath("/matlab/superCriptoOracleTrend/superCriptoOracleTrend");

        URI uri = uri_template.build();
        GenericUrl generic_url = new GenericUrl(uri);

        HttpContent request_payload = new JsonHttpContent(JSON_FACTORY, matlab_model);

        HttpRequestFactory requestFactory =
                HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {
                    @Override
                    public void initialize(HttpRequest request) {
                        request.setParser(new JsonObjectParser(JSON_FACTORY));
                    }
                });

        HttpRequest request = requestFactory.buildPostRequest(generic_url, request_payload);


        Next24HourAvg forecast = request.execute().parseAs(Next24HourAvg.class);

        return forecast;
{'fraction_non_alphanumeric': 0.08598312783906555, 'fraction_numerical': 0.009085009733939001, 'mean_word_length': 2.9093214965123653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3215237', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1672, 'n_words': 301}