<commit_before>Marbles.HTTP.Client = class HTTPClient
  constructor: (@options = {}) ->

  request: (method, args) =>
    new Marbles.HTTP(_.extend(args, {
      method: method
      params: _.extend({}, @options.params, args.params)
      middleware: [].concat(@options.middleware || []).concat(args.middleware || [])
      callback: (res, xhr) =>
        if xhr.status in [200...400]
          args.callback?.success?(res, xhr)
          @options.success?(res, xhr)
        else
          args.callback?.error?(res, xhr)
          @options.error?(res, xhr)

        args.callback?(res, xhr)
        args.callback?.complete?(res, xhr)
        @options.complete?(res, xhr)
    }))

for method in ['HEAD', 'GET', 'POST', 'PUT', 'DELETE']
  do (method) ->
    HTTPClient::[method.toLowerCase()] = -> @request(method, arguments...)

<commit_msg>Fix Marbles.HTTP.Client<commit_after>Marbles.HTTP.Client = class HTTPClient
  constructor: (@options = {}) ->

  request: (method, args) =>
    new Marbles.HTTP(_.extend({}, args, {
      method: method
      params: _.extend({}, @options.params, args.params)
      middleware: [].concat(@options.middleware || []).concat(args.middleware || [])
      callback: (res, xhr) =>
        if xhr.status in [200...400]
          args.callback?.success?(res, xhr)
          @options.success?(res, xhr)
        else
          args.callback?.error?(res, xhr)
          @options.error?(res, xhr)

        args.callback?(res, xhr)
        args.callback?.complete?(res, xhr)
        @options.complete?(res, xhr)
    }))

for method in ['HEAD', 'GET', 'POST', 'PUT', 'DELETE']
  do (method) ->
    HTTPClient::[method.toLowerCase()] = -> @request(method, arguments...)


{'fraction_non_alphanumeric': 0.1855123674911661, 'fraction_numerical': 0.007067137809187279, 'mean_word_length': 2.7177242888402624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1765159', 'n_tokens_mistral': 546, 'n_tokens_neox': 552, 'n_words': 110}