<commit_before>package play.api.libs.ws

import play.api.libs.concurrent._
import play.api.libs.iteratee._
import play.api.libs.iteratee.Input._
import play.api.libs.json._
import play.api.http.{ Writeable, ContentTypeOf }
import com.ning.http.client.{
  AsyncHttpClient,
  AsyncHttpClientConfig,
  RequestBuilderBase,
  FluentCaseInsensitiveStringsMap,
  HttpResponseBodyPart,
  HttpResponseHeaders,
  HttpResponseStatus,
  Response => AHCResponse,
  PerRequestConfig
}

/**
 * Asynchronous API to to query web services, as an http client.
 *
 * Usage example:
 * {{{
 * WS.url("http://example.com/feed").get()
 * WS.url("http://example.com/item").post("content")
 * }}}
 *
 * The value returned is a Promise[Response],
 * and you should use Play's asynchronous mechanisms to use this response.
 *
 */
object WS {

  import com.ning.http.client.Realm.{ AuthScheme, RealmBuilder }

  /**
   * The underlying HTTP client.
   */
  lazy val client = {
    import play.api.Play.current
    val config = new AsyncHttpClientConfig.Builder()
      .setConnectionTimeoutInMs(current.configuration.getMilliseconds("ws.timeout").getOrElse(120L).toInt)
      .setFollowRedirects(current.configuration.getBoolean("ws.followRedirects").getOrElse(true))
    current.configuration.getString("ws.useragent").map { useragent =>
      config.setUserAgent(useragent)
    }
    new AsyncHttpClient(config.build())
  }

  /**
   * Prepare a new request. You can then construct it by chaining calls.
   *
   * @param url the URL to request
   */
  def url(url: String): WSRequestHolder = WSRequestHolder(url, Map(), Map(), None, None, None, None)<commit_msg>Fix the default timeout for the WS<commit_after>package play.api.libs.ws

import play.api.libs.concurrent._
import play.api.libs.iteratee._
import play.api.libs.iteratee.Input._
import play.api.libs.json._
import play.api.http.{ Writeable, ContentTypeOf }
import com.ning.http.client.{
  AsyncHttpClient,
  AsyncHttpClientConfig,
  RequestBuilderBase,
  FluentCaseInsensitiveStringsMap,
  HttpResponseBodyPart,
  HttpResponseHeaders,
  HttpResponseStatus,
  Response => AHCResponse,
  PerRequestConfig
}

/**
 * Asynchronous API to to query web services, as an http client.
 *
 * Usage example:
 * {{{
 * WS.url("http://example.com/feed").get()
 * WS.url("http://example.com/item").post("content")
 * }}}
 *
 * The value returned is a Promise[Response],
 * and you should use Play's asynchronous mechanisms to use this response.
 *
 */
object WS {

  import com.ning.http.client.Realm.{ AuthScheme, RealmBuilder }

  /**
   * The underlying HTTP client.
   */
  lazy val client = {
    import play.api.Play.current
    val config = new AsyncHttpClientConfig.Builder()
      .setConnectionTimeoutInMs(current.configuration.getMilliseconds("ws.timeout").getOrElse(120000L).toInt)
      .setFollowRedirects(current.configuration.getBoolean("ws.followRedirects").getOrElse(true))
    current.configuration.getString("ws.useragent").map { useragent =>
      config.setUserAgent(useragent)
    }
    new AsyncHttpClient(config.build())
  }

  /**
   * Prepare a new request. You can then construct it by chaining calls.
   *
   * @param url the URL to request
   */
  def url(url: String): WSRequestHolder = WSRequestHolder(url, Map(), Map(), None, None, None, None)
{'fraction_non_alphanumeric': 0.12378640776699029, 'fraction_numerical': 0.0027305825242718447, 'mean_word_length': 3.987897125567322, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4227948', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1000, 'n_words': 231}