<commit_before>package com.chrisdempewolf.pinterest.methods.network

import org.apache.http.client.methods.CloseableHttpResponse
import org.apache.http.client.methods.HttpDelete
import org.apache.http.client.methods.HttpPost
import org.apache.http.client.methods.HttpRequestBase
import org.apache.http.impl.client.HttpClients
import org.apache.http.util.EntityUtils

import java.io.IOException

object NetworkHelper {

    @Throws(IOException::class)
    fun submitDeleteRequest(httpDelete: HttpDelete): ResponseMessageAndStatusCode {
        return submitRequest(httpDelete)
    }

    @Throws(IOException::class)
    fun submitPostRequest(httpPost: HttpPost): ResponseMessageAndStatusCode {
        return submitRequest(httpPost)
    }

    @Throws(IOException::class)
    private fun submitRequest(httpRequestBase: HttpRequestBase): ResponseMessageAndStatusCode {
        HttpClients.createDefault().execute(httpRequestBase).use { response ->
            val responseBody = EntityUtils.toString(response.entity)
            val statusCode = response.statusLine.statusCode

            return ResponseMessageAndStatusCode(statusCode, responseBody)
        }
    }
}
<commit_msg>update network helper to use http client fluid interface<commit_after>package com.chrisdempewolf.pinterest.methods.network

import org.apache.http.HttpResponse
import org.apache.http.NameValuePair
import org.apache.http.client.fluent.Request
import org.apache.http.client.methods.CloseableHttpResponse
import org.apache.http.client.methods.HttpDelete
import org.apache.http.client.methods.HttpPost
import org.apache.http.client.methods.HttpRequestBase
import org.apache.http.impl.client.HttpClients
import org.apache.http.util.EntityUtils

import java.io.IOException
import java.net.URI

object NetworkHelper {

    @JvmStatic
    @Throws(IOException::class)
    fun submitDeleteRequest(url: URI): ResponseMessageAndStatusCode {
        val response = Request.Delete(url)
                .execute()
                .returnResponse()

        return convertResponse(response)
    }

    @Throws(IOException::class)
    fun submitPostRequest(httpPost: HttpPost): ResponseMessageAndStatusCode {
        return submitRequest(httpPost)
    }

    @JvmStatic
    private fun convertResponse(response: HttpResponse): ResponseMessageAndStatusCode {
        return ResponseMessageAndStatusCode(response.statusLine.statusCode, EntityUtils.toString(response.entity))
    }

            return ResponseMessageAndStatusCode(statusCode, responseBody)
        }
    }
}

{'fraction_non_alphanumeric': 0.08284023668639054, 'fraction_numerical': 0.0, 'mean_word_length': 4.228865979381443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5713556', 'n_tokens_mistral': 671, 'n_tokens_neox': 666, 'n_words': 115}