<commit_before>import 'dart:async';
import 'dart:convert';

import 'package:http/src/response.dart';

/// The rest client, this is the class you want to use.
/// On web use the [new HttpRestClient.root] constructor to obtain preconfigured
/// RestClient.
///
class RestClient {

  HttpClient _httpClient;

  RestClient _parent;
  String _url;

  Map<String, String> _headers = {};
  Map<String, dynamic /* String or List<String> */> _params = {};

  Accepts _accepts;
  Produces _produces;
  int _workingCount = 0;

  RestClient(HttpClient httpClient, RestClient parent, String url, {Map<String, String> headers}) {
    _parent = parent;
    UrlParseResult parsedUrl = parseUrl(url);
    _url = parsedUrl.url;
    _params = parsedUrl.params;
    _httpClient = httpClient;
    if (headers == null) headers = {};
    _headers = headers;
    accepts('application/json', defaultJsonDeserializer);
    produces('application/json', defaultJsonSerializer);
  }

  RestClient child(String urlPart, {Map<String, String> headers}) {
    return new RestClient(_httpClient, this, urlPart, headers: headers);
  }

  /// Configure Accept header with appropriate [Deserializer].
  RestClient accepts(String mime, Deserializer deserializer) {
    this._accepts = new Accepts.nonbinary(mime, deserializer);

    return this;
  }

  /// Configure Accept header to receive binary data without any processing.
  RestClient acceptsBinary(String mime) {
    this._accepts = new Accepts(mime, null, true);

    return this;
  }

  /// Configure Content-Type header to submit data as List<int> without serialization.
  RestClient producesBinary(String mime) {
    this._produces = new Produces(mime, null, true);

    return this;
  }
<commit_msg>headers inherited from parent when creating child client<commit_after>import 'dart:async';
import 'dart:convert';

import 'package:http/src/response.dart';

/// The rest client, this is the class you want to use.
/// On web use the [new HttpRestClient.root] constructor to obtain preconfigured
/// RestClient.
///
class RestClient {

  HttpClient _httpClient;

  RestClient _parent;
  String _url;

  Map<String, String> _headers = {};
  Map<String, dynamic /* String or List<String> */> _params = {};

  Accepts _accepts;
  Produces _produces;
  int _workingCount = 0;

  RestClient(HttpClient httpClient, RestClient parent, String url, {Map<String, String> headers}) {
    _parent = parent;
    UrlParseResult parsedUrl = parseUrl(url);
    _url = parsedUrl.url;
    _params = parsedUrl.params;
    _httpClient = httpClient;
    if (headers == null) headers = {};
    _headers = headers;
    accepts('application/json', defaultJsonDeserializer);
    produces('application/json', defaultJsonSerializer);
  }

  RestClient child(String urlPart, {Map<String, String> headers}) {
    return new RestClient(_httpClient, this, urlPart, headers: headers ?? _headers);
  }

  /// Configure Accept header with appropriate [Deserializer].
  RestClient accepts(String mime, Deserializer deserializer) {
    this._accepts = new Accepts.nonbinary(mime, deserializer);

    return this;
  }

  /// Configure Accept header to receive binary data without any processing.
  RestClient acceptsBinary(String mime) {
    this._accepts = new Accepts(mime, null, true);

    return this;
  }

  /// Configure Content-Type header to submit data as List<int> without serialization.
  RestClient producesBinary(String mime) {
    this._produces = new Produces(mime, null, true);

    return this;
  }

{'fraction_non_alphanumeric': 0.1062553556126821, 'fraction_numerical': 0.0005712653527563553, 'mean_word_length': 3.932394366197183, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1517856', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1016, 'n_words': 312}