<commit_before>{ stdenv, buildPythonPackage, fetchPypi
, pytest_3, pytestrunner, hypothesis }:

buildPythonPackage rec {
  pname = "chardet";
  version = "3.0.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1bpalpia6r5x1kknbk11p1fzph56fmmnp405ds8icksd3knr5aw4";
  };

  checkInputs = [ pytest_3 pytestrunner hypothesis ];

  meta = with stdenv.lib; {
    homepage = https://github.com/chardet/chardet;
    description = "Universal encoding detector";
    license = licenses.lgpl2;
    maintainers = with maintainers; [ domenkozar ];
  };
}
<commit_msg>pythonPackages.chardet: fix pytest 4 support<commit_after>{ stdenv, buildPythonPackage, fetchPypi, fetchpatch
, pytest, pytestrunner, hypothesis }:

buildPythonPackage rec {
  pname = "chardet";
  version = "3.0.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1bpalpia6r5x1kknbk11p1fzph56fmmnp405ds8icksd3knr5aw4";
  };

  patches = [
    # Add pytest 4 support. See: https://github.com/chardet/chardet/pull/174
    (fetchpatch {
      url = "https://github.com/chardet/chardet/commit/0561ddcedcd12ea1f98b7ddedb93686ed8a5ffa4.patch";
      sha256 = "1y1xhjf32rdhq9sfz58pghwv794f3w2f2qcn8p6hp4pc8jsdrn2q";
    })
  ];

  checkInputs = [ pytest pytestrunner hypothesis ];

  meta = with stdenv.lib; {
    homepage = https://github.com/chardet/chardet;
    description = "Universal encoding detector";
    license = licenses.lgpl2;
    maintainers = with maintainers; [ domenkozar ];
  };
}

{'fraction_non_alphanumeric': 0.11043360433604336, 'fraction_numerical': 0.06233062330623306, 'mean_word_length': 3.989864864864865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6032183', 'n_tokens_mistral': 612, 'n_tokens_neox': 567, 'n_words': 95}