<commit_before>package com.commutestream.sdk;

import android.util.Log;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.ResponseBody;

import retrofit.Call;
import retrofit.Callback;
import retrofit.GsonConverterFactory;
import retrofit.Response;
import retrofit.Retrofit;

/**
 * Http Client for CommuteStream Ads
 */
class HttpClient implements Client {
    private String baseURL = "https://api.commutestream.com:3000/";
    private OkHttpClient okClient;
    private Retrofit retrofit;
    private RetrofitClient client;

    HttpClient() {
        init();
    }

    HttpClient(String baseURL) {
        this.baseURL = baseURL;
        init();
    }

    private void init() {
        okClient = new OkHttpClient();
        okClient.interceptors().add(new HttpLogger());
        retrofit = new Retrofit.Builder()
                .client(okClient)
                .baseUrl(baseURL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        client = retrofit.create(RetrofitClient.class);
    }

    @Override
    public void getAd(AdRequest request, final AdResponseHandler adHandler) {
        Callback<AdResponse> callback = new Callback<AdResponse>() {
            @Override
            public void onResponse(Response<AdResponse> response) {
                Log.v("CS_SDK", "Ad request successful: " + response.body().toString());
                adHandler.onSuccess(response.body());
            }

            @Override
            public void onFailure(Throwable t) {
                Log.v("CS_SDK", "Ad request error " + t.toString());
                adHandler.onError(t);
            }
        };
        Call<AdResponse> call = client.getBanner(AdRequestQueryMap.Map(request));
        call.enqueue(callback);
    }

    /**
     * Getter for the clients BaseURL
     *
     * @return
     */
    public String getBaseURL() { return baseURL; }
}<commit_msg>Ensure the response body is not null<commit_after>package com.commutestream.sdk;

import android.util.Log;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.ResponseBody;

import retrofit.Call;
import retrofit.Callback;
import retrofit.GsonConverterFactory;
import retrofit.Response;
import retrofit.Retrofit;

/**
 * Http Client for CommuteStream Ads
 */
class HttpClient implements Client {
    private String baseURL = "https://api.commutestream.com:3000/";
    private OkHttpClient okClient;
    private Retrofit retrofit;
    private RetrofitClient client;

    HttpClient() {
        init();
    }

    HttpClient(String baseURL) {
        this.baseURL = baseURL;
        init();
    }

    private void init() {
        okClient = new OkHttpClient();
        okClient.interceptors().add(new HttpLogger());
        retrofit = new Retrofit.Builder()
                .client(okClient)
                .baseUrl(baseURL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        client = retrofit.create(RetrofitClient.class);
    }

    @Override
    public void getAd(AdRequest request, final AdResponseHandler adHandler) {
        Callback<AdResponse> callback = new Callback<AdResponse>() {
            @Override
            public void onResponse(Response<AdResponse> response) {
                if(response.body() != null) {
                    Log.v("CS_SDK", "Ad request successful: " + response.body().toString());
                    adHandler.onSuccess(response.body());
                } else {
                    Log.v("CS_SDK", "Ad request null response, HTTP Code: " + response.code() + " , Raw Body: " + response.raw());
                    adHandler.onError(new Exception("Empty or Incorrect HTTP Response"));
                }
            }

            @Override
            public void onFailure(Throwable t) {
                Log.v("CS_SDK", "Ad request error " + t.toString());
                adHandler.onError(t);
            }
        };
        Call<AdResponse> call = client.getBanner(AdRequestQueryMap.Map(request));
        call.enqueue(callback);
    }

    /**
     * Getter for the clients BaseURL
     *
     * @return
     */
    public String getBaseURL() { return baseURL; }
}
{'fraction_non_alphanumeric': 0.10794780545670225, 'fraction_numerical': 0.0018979833926453143, 'mean_word_length': 2.268217054263566, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5932709', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1145, 'n_words': 252}