<commit_before>{ lib
, buildPythonPackage
, fetchFromGitHub
, pexpect
, notebook
, nix
}:

buildPythonPackage rec {
  pname = "nix-kernel";
  version = "unstable-2020-04-26";

  src = fetchFromGitHub {
    owner = "GTrunSec";
    repo = "nix-kernel";
    rev = "dfa42d0812d508ded99f690ee1a83281d900a3ec";
    sha256 = "1lf4rbbxjmq9h6g3wrdzx3v3dn1bndfmiybxiy0sjavgb6lzc8kq";
  };

  postPatch = ''
    substituteInPlace nix-kernel/kernel.py \
      --replace "'nix'" "'${nix}/bin/nix'" \
      --replace "'nix repl'" "'${nix}/bin/nix repl'"

    substituteInPlace setup.py \
      --replace "cmdclass={'install': install_with_kernelspec}," ""
  '';
<commit_msg>pythonPackages.nix-kernel: disable on Python 2<commit_after>{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy3k
, pexpect
, notebook
, nix
}:

buildPythonPackage rec {
  pname = "nix-kernel";
  version = "unstable-2020-04-26";

  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "GTrunSec";
    repo = "nix-kernel";
    rev = "dfa42d0812d508ded99f690ee1a83281d900a3ec";
    sha256 = "1lf4rbbxjmq9h6g3wrdzx3v3dn1bndfmiybxiy0sjavgb6lzc8kq";
  };

  postPatch = ''
    substituteInPlace nix-kernel/kernel.py \
      --replace "'nix'" "'${nix}/bin/nix'" \
      --replace "'nix repl'" "'${nix}/bin/nix repl'"

    substituteInPlace setup.py \
      --replace "cmdclass={'install': install_with_kernelspec}," ""
  '';

{'fraction_non_alphanumeric': 0.15090252707581228, 'fraction_numerical': 0.06859205776173286, 'mean_word_length': 3.6354515050167224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7483292', 'n_tokens_mistral': 617, 'n_tokens_neox': 547, 'n_words': 85}